-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to setup external library with ng2admin (like ng2translate) #8
Comments
@sanathpathiraja if you want to globally include |
yes i did that. app/index.ts // Application wide providers app.component.ts isMenuCollapsed:boolean = false; but translate not working. |
@sanathpathiraja still you haven't loaded the pipe globally, here the minimal steps:
import {TranslatePipe} from 'ng2-translate/ng2-translate';
// application_pipes: pipes that are global through out the application
export const APPLICATION_PIPES = [
TranslatePipe // <----- add the pipe HERE
];
// the rest of the code
import {TRANSLATE_PROVIDERS} from 'ng2-translate/ng2-translate';
/*
* Application Providers/Directives/Pipes
* providers/directives/pipes that only live in our browser environment
*/
export const APPLICATION_PROVIDERS = [
...FORM_PROVIDERS,
...HTTP_PROVIDERS,
...ROUTER_PROVIDERS,
TRANSLATE_PROVIDERS, // <--- HERE the providers
{provide: LocationStrategy, useClass: HashLocationStrategy }
];
// the rest of the code
|
yes, I added that after I change `export function main(initialHmrState?: any): Promise { return bootstrap(App, [ after run it perfectly. |
reveal traffic card
getting error,
browser_adapter.ts?9397:78 EXCEPTION: Error: Uncaught (in promise): Template parse errors:
The pipe 'translate' could not be found
i added
app.component.ts
import {TRANSLATE_PROVIDERS, TranslateService, TranslatePipe, TranslateLoader, TranslateStaticLoader} from 'ng2-translate/ng2-translate';
@component({
selector: 'app',
pipes: [TranslatePipe],
but errors comes.
The text was updated successfully, but these errors were encountered: