-
Notifications
You must be signed in to change notification settings - Fork 4
/
third-party-licenses.txt
6708 lines (4942 loc) · 276 KB
/
third-party-licenses.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Annex 1
to the NETGRIF Community license for this project
The following NPM packages may be included in this product:
- @angular-devkit/core@13.3.1
- @angular-devkit/schematics@13.3.1
- @schematics/angular@13.3.1
These packages each contain the following license and notice below:
The MIT License
Copyright (c) 2017 Google, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----------
The following NPM package may be included in this product:
- @angular-material-components/datetime-picker@4.0.7
This package contains the following license and notice below:
MIT License
Copyright (c) 2020 HO Hong Quan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-----------
The following NPM package may be included in this product:
- @angular-material-components/moment-adapter@4.0.1
This package contains the following license and notice below:
# NgxMatMomentAdapter
## Description
Moment Adapter for [@angular-material-components/datetime-picker](https://www.npmjs.com/package/@angular-material-components/datetime-picker)
## Getting started
```
npm install --save @angular-material-components/moment-adapter
```
## Setup
```
import { NgxMatMomentModule } from '@angular-material-components/moment-adapter';
@NgModule({
...
imports: [
NgxMatMomentModule,
NgxMatDatetimePickerModule,
],
...
})
export class AppModule { }
```
## License
MIT
-----------
The following NPM packages may be included in this product:
- @angular/animations@13.3.1
- @angular/common@13.3.1
- @angular/compiler@13.3.1
- @angular/core@13.3.1
- @angular/forms@13.3.1
- @angular/platform-browser-dynamic@13.3.1
- @angular/platform-browser@13.3.1
- @angular/router@13.3.1
These packages each contain the following license and notice below:
Angular
=======
The sources for this package are in the main [Angular](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in [Angular documentation](https://angular.io/docs).
License: MIT
-----------
The following NPM packages may be included in this product:
- @angular/cdk@13.3.1
- @angular/flex-layout@10.0.0-beta.32
- @angular/material-moment-adapter@13.3.1
- @angular/material@13.3.1
These packages each contain the following license and notice below:
The MIT License
Copyright (c) 2020 Google LLC.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------
The following NPM package may be included in this product:
- @covalent/core@3.1.2
This package contains the following license and notice below:
# core
Core Teradata UI Platform for layouts, icons, custom components and themes. This should be added as a dependency for any project that wants to use layouts, icons and themes for Angular Material.
The core will have custom components that enforce standards and best practices through built-in design patterns.
## Installation
This component can be installed as npm package.
```bash
npm i -save @covalent/core
```
## Setup
Import the modules from `@covalent/core` as needed in your NgModule:
```typescript
import { CovalentLayoutModule } from '@covalent/core/layout';
import { CovalentStepsModule } from '@covalent/core/steps';
/* and many more */
@NgModule({
imports: [
CovalentLayoutModule,
CovalentStepsModule,
...
],
...
})
export class MyModule {}
```
## Styles, Icons and Theming
See [theming](https://teradata.github.io/covalent/#/docs/theme) in the covalent docs for more info
Core Teradata UI Platform comes with a base CSS file `@covalent/core/common/platform.css` (includes icons).
-----------
The following NPM package may be included in this product:
- @covalent/highlight@3.1.2
This package contains the following license and notice below:
## TdHighlightComponent: td-highlight
`td-highlight` is an @angular component that uses native **@angular** to parse code to HTML elements. It is based on [highlight.js](https://highlightjs.org/) library.
This implementation supports all the Common languages in *highlight.js*.
**Note:** This module uses the **DomSanitizer** service to ~sanitize~ the parsed `html` from the `highlight.js` lib to avoid **XSS** issues.
By default, `--dev` build will log the following message in the console to let you know:
`WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).`
## API Summary
#### Inputs
+ lang: string
+ Language of the code content to be parsed as highlighted html.
> **DEPRECATION WARNING: lang attribute is deprecated and it will be removed in v4.0.0**
+ codeLang: string
+ Language of the code content to be parsed as highlighted html.
+ content: string
+ Code content to be parsed as highlighted html. Used to load data dynamically. e.g. `.ts` content.
+ copyCodeToClipboard?: boolean
+ Display copy button on code snippets to copy code to clipboard.
+ copyCodeTooltips?: ICopyCodeTooltips
+ Tooltips for copy button to copy and upon copying.
For reference:
```
interface ICopyCodeTooltips {
copy?: string;
copied?: string;
}
```
#### Events
+ contentReady: function
+ Event emitted after the highlight content rendering is finished.
## Installation
This component can be installed as npm package.
```bash
npm i -save @covalent/highlight
```
## Setup
Import the **[CovalentHighlightModule]** in your NgModule:
```typescript
import { CovalentHighlightModule } from '@covalent/highlight';
@NgModule({
imports: [
CovalentHighlightModule,
...
],
...
})
export class MyModule {}
```
### Theming
The `highlight` module comes with its own default `covalent` theme which you can use by importing our theme scss file.
```css
@import '~@covalent/highlight/highlight-theme';
@include covalent-highlight-theme();
```
Alternatively, you can use the *highlight.js* pre-built [themes](https://github.com/isagalaev/highlight.js/tree/master/src/styles) by loading them either by an import:
```css
@import '~highlight.js/styles/vs.css';
```
Loading them in the `.angular-cli.json`:
```json
"styles": [
"/path/to/node_modules/highlight.js/styles/vs.css"
]
```
Or by loading them in the `index.html` file:
```html
<link rel="stylesheet" href="/path/to/node_modules/highlight.js/styles/vs.css">
```
## Usage
Simply create a template literal string with your code and bind your snippets in `<td-highlight>{{code}}</td-highlight>`.
Example for **HTML** usage:
```typescript
@Component({
template: `
<td-highlight codeLang="html">
{{ code }}
</td-highlight>
`,
})
class ExampleComponent {
code: string = `
<td-highlight codeLang="html">
<h1>hello world!</h1>
<span>{ {property} }</span>
</td-highlight>
`;
}
```
Example for **CSS** usage:
```typescript
@Component({
template: `
<td-highlight codeLang="css">
{{ code }}
</td-highlight>
`,
})
class ExampleComponent {
code: string = `
pre {
display: block;
overflow-x: auto;
padding: 0;
margin: 0;
background: #002451;
color: white;
font-family: Menlo, Monaco, "Andale Mono", "lucida console", "Courier New", monospace;
line-height: 1.45;
tab-size: 2;
-webkit-font-smoothing: auto;
-webkit-text-size-adjust: none;
position: relative;
border-radius: 2px;
}
`;
}
```
Example for **Typescript**:
```typescript
@Component({
template: `
<td-highlight codeLang="typescript">
{{ code }}
</td-highlight>
`,
})
class ExampleComponent {
code: string = `
import { Injectable } from '@angular/core';
import { Observable, Subject } from 'rxjs';
@Injectable()
export class Service {
private _sources: {[key : string]: Subject<any>} = {};
private _observables: {[key: string]: Observable<any>} = {};
constructor() {
}
public register(name) : Observable<any> {
this._sources[name] = new Subject<any>();
this._observables[name] = this._sources[name].asObservable();
return this._observables[name];
}
public emit(name: string): void {
if(this._sources[name]) {
this._sources[name].next(null);
}
}
}
`;
}
```
-----------
The following NPM package may be included in this product:
- @covalent/markdown@3.1.2
This package contains the following license and notice below:
## TdMarkdownComponent: td-markdown
`<td-markdown>` is a component that parses and renders Github flavored markdown. It is based on the [showdown](https://github.com/showdownjs/showdown/) library.
**Note:** This module uses the **DomSanitizer** service to sanitize the parsed html from the showdown lib to avoid **XSS** issues.
By default, `--dev` build will log the following message in the console to let you know:
`WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).`
## API Summary
#### Inputs
+ content?: string
+ Markdown format content to be parsed as html markup.
+ Used to load data dynamically. e.g. `README.md` content.
+ simpleLineBreaks?: string
+ Sets whether newline characters inside paragraphs and spans are parsed as <br/>.
+ Defaults to false.
+ hostedUrl?: string
+ If markdown contains relative paths, this is required to generate correct urls.
+ anchor?: string
+ Anchor to jump to.
#### Events
+ contentReady: undefined
+ Event emitted after the markdown content rendering is finished.
## Installation
This component can be installed as an npm package.
```bash
npm i -save @covalent/markdown
```
## Setup
Then, import the **CovalentMarkdownModule** in your NgModule:
```typescript
import { CovalentMarkdownModule } from '@covalent/markdown';
@NgModule({
imports: [
CovalentMarkdownModule,
...
],
...
})
export class MyModule {}
```
### Theming
This module comes with its own Covalent theme which uses the material theme which is used by importing our theme scss file.
```scss
@import '~@angular/material/theming';
@import '~@covalent/markdown/markdown-theme';
@include mat-core();
$primary: mat-palette($mat-orange, 800);
$accent: mat-palette($mat-light-blue, 600, A100, A400);
$warn: mat-palette($mat-red, 600);
$theme: mat-light-theme($primary, $accent, $warn);
@include covalent-markdown-theme($theme);
```
## Example
**Html:**
```html
<td-markdown>
# Heading
## Sub Heading (H2)
### Steps (H2)
</td-markdown>
```
**Output:**
# Heading
## Sub Heading (H2)
### Steps (H2)
-----------
The following NPM package may be included in this product:
- @covalent/text-editor@3.1.2
This package contains the following license and notice below:
## TdTextEditorComponent: td-text-editor
`<td-text-editor>` element generates an easymde markdown editor.
## API Summary
#### Inputs
+ value?: string
+ value of text in editor
+ options?: object
+ Options Object of valid Configurations listed here: <a href="https://github.com/Ionaru/easy-markdown-editor#configuration">https://github.com/Ionaru/easy-markdown-editor#configuration</a>
#### Properties
+ isPreviewActive?: function()
+ is the Preview Active. Returns boolean
+ isSideBySideActive?: function()
+ is the Side By Side Active. Returns boolean
+ isFullscreenActive?: function()
+ is Full Screen Active. Returns boolean
+ clearAutosavedValue?: function()
+ clears Auto Saved Value. Returns void
+ toTextArea?: function()
+ reverts to the Initial textarea. Returns void
+ easyMDE?: function()
+ getter function for the underlying easyMDE Object. Returns EasyMDE
## Installation
This component can be installed as npm package.
```bash
npm install @covalent/text-editor
```
## Setup
Import the **CovalentTextEditorModule** in your NgModule:
```typescript
import { CovalentTextEditorModule } from '@covalent/text-editor';
@NgModule({
imports: [
CovalentTextEditorModule,
...
],
...
})
export class MyModule {}
```
### Usage
```html
<td-text-editor [value]="Some Text" [options]="options"></td-text-editor>
```
```typescript
class MyComponent {
options: any = {
lineWrapping: true,
toolbar: false,
...
};
}
```
-----------
The following NPM package may be included in this product:
- @netgrif/components-core@6.0.0-rc.5
This package contains the following license and notice below:
# Netgrif Components Core library
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.0-rc.7.
## Code scaffolding
Run `ng generate component component-name --project netgrif-components-core` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project netgrif-components-core`.
> Note: Don't forget to add `--project netgrif-components-core` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build netgrif-components-core` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build netgrif-components-core`, go to the dist folder `cd dist/netgrif-components-core` and run `npm publish`.
## Running unit tests
Run `ng test netgrif-components-core` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
-----------
The following NPM package may be included in this product:
- @ngx-translate/core@13.0.0
This package contains the following license and notice below:
# @ngx-translate/core [![Build Status](https://travis-ci.org/ngx-translate/core.svg?branch=master)](https://travis-ci.org/ngx-translate/core) [![npm version](https://badge.fury.io/js/%40ngx-translate%2Fcore.svg)](https://badge.fury.io/js/%40ngx-translate%2Fcore)
The internationalization (i18n) library for Angular.
Simple example using ngx-translate: https://stackblitz.com/github/ngx-translate/example
Get the complete changelog here: https://github.com/ngx-translate/core/releases
## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [Import the TranslateModule](#1-import-the-translatemodule)
* [SharedModule](#sharedmodule)
* [Lazy loaded modules](#lazy-loaded-modules)
* [Configuration](#configuration)
* [AoT](#aot)
* [Define the default language for the application](#2-define-the-default-language-for-the-application)
* [Init the TranslateService for your application](#3-init-the-translateservice-for-your-application)
* [Define the translations](#4-define-the-translations)
* [Use the service, the pipe or the directive](#5-use-the-service-the-pipe-or-the-directive)
* [Use HTML tags](#6-use-html-tags)
* [API](#api)
* [TranslateService](#translateservice)
* [Properties](#properties)
* [Methods](#methods)
* [Write & use your own loader](#write--use-your-own-loader)
* [Example](#example)
* [How to use a compiler to preprocess translation values](#how-to-use-a-compiler-to-preprocess-translation-values)
* [How to handle missing translations](#how-to-handle-missing-translations)
* [Example](#example-1)
* [Parser](#parser)
* [Methods](#methods)
* [FAQ](#faq)
* [I'm getting an error `npm ERR! peerinvalid Peer [...]`](#im-getting-an-error-npm-err-peerinvalid-peer-)
* [Plugins](#plugins)
* [Editors](#editors)
* [Additional Framework Support](#additional-framework-support)
## Installation
First you need to install the npm module:
```sh
npm install @ngx-translate/core --save
```
Choose the version corresponding to your Angular version:
Angular | @ngx-translate/core | @ngx-translate/http-loader
----------- | ------------------- | --------------------------
10 | 13.x+ | 6.x+
9 | 12.x+ | 5.x+
8 | 12.x+ | 4.x+
7 | 11.x+ | 4.x+
6 | 10.x | 3.x
5 | 8.x to 9.x | 1.x to 2.x
4.3 | 7.x or less | 1.x to 2.x
2 to 4.2.x | 7.x or less | 0.x
---
**If you use SystemJS** to load your files, you can check the [plunkr example](https://plnkr.co/edit/XXwyUYS6ZL7qVD9I2l0g?p=preview) for a working setup that uses the cdn [https://unpkg.com/](https://unpkg.com/).
If you're importing directly from `node_modules`, you should edit your systemjs config file and add `'@ngx-translate/core': 'node_modules/@ngx-translate/core/bundles'` in the map and `'@ngx-translate/core' : { defaultExtension: 'js' }` in packages.
## Usage
#### 1. Import the `TranslateModule`:
Finally, you can use ngx-translate in your Angular project. You have to import `TranslateModule.forRoot()` in the root NgModule of your application.
The [`forRoot`](https://angular.io/api/router/RouterModule#forroot) static method is a convention that provides and configures services at the same time.
Make sure you only call this method in the root module of your application, most of the time called `AppModule`.
This method allows you to configure the `TranslateModule` by specifying a loader, a parser and/or a missing translations handler.
```ts
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {TranslateModule} from '@ngx-translate/core';
@NgModule({
imports: [
BrowserModule,
TranslateModule.forRoot()
],
bootstrap: [AppComponent]
})
export class AppModule { }
```
##### SharedModule
If you use a [`SharedModule`](https://angular.io/guide/sharing-ngmodules) that you import in multiple other feature modules,
you can export the `TranslateModule` to make sure you don't have to import it in every module.
```ts
@NgModule({
exports: [
CommonModule,
TranslateModule
]
})
export class SharedModule { }
```
> Note: Never call a `forRoot` static method in the `SharedModule`. You might end up with different instances of the service in your injector tree. But you can use `forChild` if necessary.
##### Lazy loaded modules
When you lazy load a module, you should use the `forChild` static method to import the `TranslateModule`.
Since lazy loaded modules use a different injector from the rest of your application, you can configure them separately with a different loader/compiler/parser/missing translations handler.
To make a child module extend translations from parent modules use `extend: true`. This will cause the service to also
use translations from its parent module.
You can also isolate the service by using `isolate: true`. In which case the service is a completely isolated instance (for translations, current lang, events, ...).
Otherwise, by default, it will share its data with other instances of the service (but you can still use a different loader/compiler/parser/handler even if you don't isolate the service).
```ts
@NgModule({
imports: [
TranslateModule.forChild({
loader: {provide: TranslateLoader, useClass: CustomLoader},
compiler: {provide: TranslateCompiler, useClass: CustomCompiler},
parser: {provide: TranslateParser, useClass: CustomParser},
missingTranslationHandler: {provide: MissingTranslationHandler, useClass: CustomHandler},
isolate: true
})
]
})
export class LazyLoadedModule { }
```
##### Configuration
By default, there is no loader available. You can add translations manually using `setTranslation` but it is better to use a loader.
You can write your own loader, or import an existing one.
For example you can use the [`TranslateHttpLoader`](https://github.com/ngx-translate/http-loader) that will load translations from files using HttpClient.
To use it, you need to install the http-loader package from @ngx-translate:
```sh
npm install @ngx-translate/http-loader --save
```
**NB: if you're still on Angular <4.3, please use Http from @angular/http with http-loader@0.1.0.**
Once you've decided which loader to use, you have to setup the `TranslateModule` to use it.
Here is how you would use the `TranslateHttpLoader` to load translations from "/assets/i18n/[lang].json" (`[lang]` is the lang that you're using, for english it could be `en`):
```ts
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {HttpClientModule, HttpClient} from '@angular/common/http';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {AppComponent} from './app';
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http);
}
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
],
bootstrap: [AppComponent]
})
export class AppModule { }
```
##### AoT
If you want to configure a custom `TranslateLoader` while using [AoT compilation](https://angular.io/docs/ts/latest/cookbook/aot-compiler.html) or [Ionic](http://ionic.io/), you must use an exported function instead of an inline function.
```ts
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
}
})
],
bootstrap: [AppComponent]
})
export class AppModule { }
```
#### 2. Define the `default language` for the application
```ts
@NgModule({
imports: [
BrowserModule,
TranslateModule.forRoot({
defaultLanguage: 'en'
})
],
providers: [
],
bootstrap: [AppComponent]
})
export class AppModule { }
```
#### 3. Init the `TranslateService` for your application:
```ts
import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
@Component({
selector: 'app',
template: `
<div>{{ 'HELLO' | translate:param }}</div>
`
})
export class AppComponent {
param = {value: 'world'};
constructor(translate: TranslateService) {
// this language will be used as a fallback when a translation isn't found in the current language
translate.setDefaultLang('en');
// the lang to use, if the lang isn't available, it will use the current loader to get them
translate.use('en');
}
}
```
#### 4. Define the translations:
Once you've imported the `TranslateModule`, you can put your translations in a json file that will be imported with the `TranslateHttpLoader`. The following translations should be stored in `en.json`.
```json
{
"HELLO": "hello {{value}}"
}
```
You can also define your translations manually with `setTranslation`.
```ts
translate.setTranslation('en', {
HELLO: 'hello {{value}}'
});
```
The `TranslateParser` understands nested JSON objects. This means that you can have a translation that looks like this:
```json
{
"HOME": {
"HELLO": "hello {{value}}"
}
}
```
You can then access the value by using the dot notation, in this case `HOME.HELLO`.
#### 5. Use the service, the pipe or the directive:
You can either use the `TranslateService`, the `TranslatePipe` or the `TranslateDirective` to get your translation values.
With the **service**, it looks like this:
```ts
translate.get('HELLO', {value: 'world'}).subscribe((res: string) => {
console.log(res);
//=> 'hello world'
});
```
This is how you do it with the **pipe**:
```html
<div>{{ 'HELLO' | translate:param }}</div>
```
And in your component define `param` like this:
```ts
param = {value: 'world'};
```
You can construct the translation keys dynamically by using simple string concatenation inside the template:
```html
<ul *ngFor="let language of languages">
<li>{{ 'LANGUAGES.' + language | translate }}</li>
</ul>
```
Where `languages` is an array member of your component:
```ts
languages = ['EN', 'FR', 'BG'];
```
You can also use the output of the built-in pipes `uppercase` and `lowercase` in order to guarantee that your dynamically generated translation keys are either all uppercase or all lowercase. For example:
```html
<p>{{ 'ROLES.' + role | uppercase | translate }}</p>
```
```ts
role = 'admin';
```
will match the following translation:
```json
{
"ROLES": {
"ADMIN": "Administrator"
}
}
```
This is how you use the **directive**:
```html
<div [translate]="'HELLO'" [translateParams]="{value: 'world'}"></div>
```
Or even simpler using the content of your element as a key:
```html
<div translate [translateParams]="{value: 'world'}">HELLO</div>
```
#### 6. Use HTML tags:
You can easily use raw HTML tags within your translations.
```json
{
"HELLO": "Welcome to my Angular application!<br><strong>This is an amazing app which uses the latest technologies!</strong>"
}
```
To render them, simply use the `innerHTML` attribute with the pipe on any element.
```html
<div [innerHTML]="'HELLO' | translate"></div>
```
## API
### TranslateService
#### Properties:
- `currentLang`: The lang currently used
- `currentLoader`: An instance of the loader currently used (static loader by default)
- `onLangChange`: An EventEmitter to listen to lang change events. A `LangChangeEvent` is an object with the properties `lang: string` & `translations: any` (an object containing your translations).
example:
```ts
onLangChange.subscribe((event: LangChangeEvent) => {