2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing,
12 * software distributed under the License is distributed on an
13 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 * KIND, either express or implied. See the License for the
15 * specific language governing permissions and limitations
19 import {NgModule} from '@angular/core';
20 import {CommonModule} from '@angular/common';
21 import {PaginatedEntitiesComponent} from "./paginated-entities/paginated-entities.component";
22 import {SortedTableHeaderComponent} from "./sorted-table-header/sorted-table-header.component";
23 import {SortedTableHeaderRowComponent} from "./sorted-table-header-row/sorted-table-header-row.component";
24 import {NgbPaginationModule, NgbTooltipModule} from "@ng-bootstrap/ng-bootstrap";
25 import {TranslateCompiler, TranslateLoader, TranslateModule} from "@ngx-translate/core";
26 import {TranslateMessageFormatCompiler} from "ngx-translate-messageformat-compiler";
27 import {HttpClient} from "@angular/common/http";
28 import {TranslateHttpLoader} from "@ngx-translate/http-loader";
29 import {RouterModule} from "@angular/router";
34 PaginatedEntitiesComponent,
35 SortedTableHeaderComponent,
36 SortedTableHeaderRowComponent
44 PaginatedEntitiesComponent,
45 SortedTableHeaderComponent,
46 SortedTableHeaderRowComponent
53 TranslateModule.forChild({
55 provide: TranslateCompiler,
56 useClass: TranslateMessageFormatCompiler
59 provide: TranslateLoader,
60 useFactory: httpTranslateLoader,
66 export class SharedModule {
69 export function httpTranslateLoader(http: HttpClient) {
70 return new TranslateHttpLoader(http);
74 deepCopy(src: Object, dst: Object, overwriteWithEmptyString:boolean=true) {
75 Object.keys(src).forEach((key, idx) => {
77 if (typeof (srcEl) == 'object') {
79 if (!dst.hasOwnProperty(key)) {
83 this.deepCopy(srcEl, dstEl);
84 } else if (typeof(srcEl)=='string') {
85 if (overwriteWithEmptyString) {
88 if ((srcEl as string).length>0) {
93 // console.debug("setting " + key + " = " + srcEl);