http DI example not using root injector
yringler opened this issue · 2 comments
yringler commented
Several times at https://docs.nativescript.org/angular/ng-framework-modules/http, it is made clear that
Note that the services should be explicitly declared in providers
There are other ways to do DI in angular, notably
@Injectable({
providedIn: 'root',
})
export class MyAwesomeDataService{
// Service code...
}
or specifying an NgModule in the provided in option.
Are these also ok?
If they are ok, the documentation should be less "opinionated" in tone, and if it's not ok (or just not reccomended) the docs should say why.
NickIliev commented
lock commented
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.