1 min readAug 3, 2017
Yes it is possible to use an ng1 service in an Angular 2 component.
- The ng1 service must be declared in the ng1-upgrade-shared.providers.ts and ng1-upgrade-shared.module.ts file
- Your component must be declared as lazy in your app.routing.ts file like {path: ‘walkthrough’, loadChildren: ‘./walkthrough/walkthrough.module#WalkthroughModule’},
- Use the @Inject to use the ng1 service in your component. Declare it in the component’s constructor like @Inject(‘$translate’) private $translate:any
I hope that helps, cheers