You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-14
Original file line number
Diff line number
Diff line change
@@ -21,28 +21,21 @@ System.config({
21
21
```
22
22
23
23
Finally, you can use ng2-translate in your Angular 2 project (make sure that you've loaded the angular2/http bundle as well).
24
-
It is recommended to use `NG_TRANSLATE_PROVIDERS` in the bootstrap of your application and to never add `TranslateService` to the "providers" property of your components, this way you will keep it as a singleton.
25
-
`NG_TRANSLATE_PROVIDERS` provides a default configuration for the static translation file loader.
24
+
It is recommended to use `TRANSLATE_PROVIDERS` in the bootstrap of your application and to never add `TranslateService` to the "providers" property of your components, this way you will keep it as a singleton.
25
+
`TRANSLATE_PROVIDERS` provides a default configuration for the static translation file loader.
26
26
If you add `TranslateService` to the "providers" property of a component it will instantiate a new instance of the service that won't be initialized with the language to use or the default language.
You can setup a provider for `MissingTranslationHandler` to define a handler that will be called when the requested translation is not available.
150
+
You can setup a provider for `MissingTranslationHandler`in the bootstrap of your application (recommended), or you can use the method `setMissingTranslationHandler` later to define a handler that will be called when the requested translation is not available.
146
151
The only required method is `handle` where you can do whatever you want. Just don't forget that it will be called synchronously from the `get` & `instant` methods.
147
152
148
153
##### Example:
@@ -157,11 +162,20 @@ export class MyMissingTranslationHandler implements MissingTranslationHandler {
157
162
}
158
163
```
159
164
160
-
Setup the Missing Translation Handler in bootstrap
165
+
Setup the Missing Translation Handler in bootstrap (recommended)
0 commit comments