Service instantiated twice after APP_INITIALIZER
up vote
0
down vote
favorite
Problem is: I need to make an http call and store an object that is needed for generate dynamic routes. So, I was taking advantage of the APP_INITIALIZER.
// app.module.ts
import { ApplicationService } from './application.service';
providers: [
ApplicationService,
{
provide: APP_INITIALIZER, useFactory: appServiceFactory, deps:
[Injector, ApplicationService], multi: true
},
],
function appServiceFactory(injector: Injector, appService: ApplicationService): Function {
return () => {
return appService.loadApplication().then((app: Application) => {
/custom logic
});
});
};
}
// application.service.ts
@Injectable({
providedIn: 'root'
})
// navigation.component.ts
import { ApplicationService } from './application.service';
export class NavigationComponent implements OnInit {
constructor(private _applicationService: ApplicationService) {
}
}
But inside navigation.component, applicationservice is initialized again. I'm sure of that because if I log or put a debugger statement, the construct() method of the service is called twice.
Why even if the Service is declared as singleton with the providedIn: root
is being reinstantiated?
angular dependency-injection singleton angular6
|
show 2 more comments
up vote
0
down vote
favorite
Problem is: I need to make an http call and store an object that is needed for generate dynamic routes. So, I was taking advantage of the APP_INITIALIZER.
// app.module.ts
import { ApplicationService } from './application.service';
providers: [
ApplicationService,
{
provide: APP_INITIALIZER, useFactory: appServiceFactory, deps:
[Injector, ApplicationService], multi: true
},
],
function appServiceFactory(injector: Injector, appService: ApplicationService): Function {
return () => {
return appService.loadApplication().then((app: Application) => {
/custom logic
});
});
};
}
// application.service.ts
@Injectable({
providedIn: 'root'
})
// navigation.component.ts
import { ApplicationService } from './application.service';
export class NavigationComponent implements OnInit {
constructor(private _applicationService: ApplicationService) {
}
}
But inside navigation.component, applicationservice is initialized again. I'm sure of that because if I log or put a debugger statement, the construct() method of the service is called twice.
Why even if the Service is declared as singleton with the providedIn: root
is being reinstantiated?
angular dependency-injection singleton angular6
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
@PankajParkar added
– lucgenti
Nov 9 at 13:15
I mean to say how you are importing module inside NgModule'simports
array. this module is loaded lazily or eagerly?
– Pankaj Parkar
Nov 9 at 13:32
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
what isappServiceFactory
, I don't see that function anywhere in the code.
– Pankaj Parkar
Nov 9 at 13:39
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Problem is: I need to make an http call and store an object that is needed for generate dynamic routes. So, I was taking advantage of the APP_INITIALIZER.
// app.module.ts
import { ApplicationService } from './application.service';
providers: [
ApplicationService,
{
provide: APP_INITIALIZER, useFactory: appServiceFactory, deps:
[Injector, ApplicationService], multi: true
},
],
function appServiceFactory(injector: Injector, appService: ApplicationService): Function {
return () => {
return appService.loadApplication().then((app: Application) => {
/custom logic
});
});
};
}
// application.service.ts
@Injectable({
providedIn: 'root'
})
// navigation.component.ts
import { ApplicationService } from './application.service';
export class NavigationComponent implements OnInit {
constructor(private _applicationService: ApplicationService) {
}
}
But inside navigation.component, applicationservice is initialized again. I'm sure of that because if I log or put a debugger statement, the construct() method of the service is called twice.
Why even if the Service is declared as singleton with the providedIn: root
is being reinstantiated?
angular dependency-injection singleton angular6
Problem is: I need to make an http call and store an object that is needed for generate dynamic routes. So, I was taking advantage of the APP_INITIALIZER.
// app.module.ts
import { ApplicationService } from './application.service';
providers: [
ApplicationService,
{
provide: APP_INITIALIZER, useFactory: appServiceFactory, deps:
[Injector, ApplicationService], multi: true
},
],
function appServiceFactory(injector: Injector, appService: ApplicationService): Function {
return () => {
return appService.loadApplication().then((app: Application) => {
/custom logic
});
});
};
}
// application.service.ts
@Injectable({
providedIn: 'root'
})
// navigation.component.ts
import { ApplicationService } from './application.service';
export class NavigationComponent implements OnInit {
constructor(private _applicationService: ApplicationService) {
}
}
But inside navigation.component, applicationservice is initialized again. I'm sure of that because if I log or put a debugger statement, the construct() method of the service is called twice.
Why even if the Service is declared as singleton with the providedIn: root
is being reinstantiated?
angular dependency-injection singleton angular6
angular dependency-injection singleton angular6
edited Nov 14 at 10:25
asked Nov 9 at 12:56
lucgenti
13212
13212
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
@PankajParkar added
– lucgenti
Nov 9 at 13:15
I mean to say how you are importing module inside NgModule'simports
array. this module is loaded lazily or eagerly?
– Pankaj Parkar
Nov 9 at 13:32
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
what isappServiceFactory
, I don't see that function anywhere in the code.
– Pankaj Parkar
Nov 9 at 13:39
|
show 2 more comments
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
@PankajParkar added
– lucgenti
Nov 9 at 13:15
I mean to say how you are importing module inside NgModule'simports
array. this module is loaded lazily or eagerly?
– Pankaj Parkar
Nov 9 at 13:32
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
what isappServiceFactory
, I don't see that function anywhere in the code.
– Pankaj Parkar
Nov 9 at 13:39
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
@PankajParkar added
– lucgenti
Nov 9 at 13:15
@PankajParkar added
– lucgenti
Nov 9 at 13:15
I mean to say how you are importing module inside NgModule's
imports
array. this module is loaded lazily or eagerly?– Pankaj Parkar
Nov 9 at 13:32
I mean to say how you are importing module inside NgModule's
imports
array. this module is loaded lazily or eagerly?– Pankaj Parkar
Nov 9 at 13:32
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
what is
appServiceFactory
, I don't see that function anywhere in the code.– Pankaj Parkar
Nov 9 at 13:39
what is
appServiceFactory
, I don't see that function anywhere in the code.– Pankaj Parkar
Nov 9 at 13:39
|
show 2 more comments
3 Answers
3
active
oldest
votes
up vote
0
down vote
accepted
The reason for this is that once you include Router
in dependencies to your APP_INITIALIZER
factory you get circular dependency (https://github.com/angular/angular/blob/4c2ce4e8ba4c5ac5ce8754d67bc6603eaad4564a/packages/router/src/router_module.ts#L61-L64).
ApplicationService
|
TestService
|
Router
|
ApplicationRef
|
ApplicationInitStatus
|
APP_INITIALIZER
|
ApplicationService
To solve this you can get Router lazily:
export class TestService {
get router() {
return this.injector.get(Router)
}
constructor(private _http: HttpClient, private injector: Injector ) {
}
}
Forked Stackblitz
add a comment |
up vote
1
down vote
Based on your Explanation that you have added the providedIn: root
in the application.service.ts
, that means it will be added to the root module (i.e Appmodule.ts) and again in the Appmodule.ts
in your provider
array you are adding ApplicationService
.
From this Blog its state that
"There is now a new, recommended, way to register a provider, directly
inside the @Injectable() decorator, using the new providedIn
attribute. It accepts 'root' as a value or any module of your
application. When you use 'root', your injectable will be registered
as a singleton in the application, and you don’t need to add it to the
providers of the root module. Similarly, if you use providedIn:
UsersModule, the injectable is registered as a provider of the
UsersModule without adding it to the providers of the module."
this is creating the service to be reinstantiated
Edit1 :
Another thing to check is ,
1. How are you calling this service i mean in Dev mode or Prod mode , if its dev mode then service will be called twice
If you're running in development mode, it will run the function at
least twice. since in development mode it does a check, changes, then
rechecks to verify, where production mode only does the first check,
assuming you've done your quality assurance and resolved any values
the get changed post checking.
Source
Try to check in Prod Mode and verify it..
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
|
show 4 more comments
up vote
0
down vote
Found the problem: it was because of the Router, needed as dependency by a service injected in ApplicationService.
See example:
https://stackblitz.com/edit/angular-xwyugy
When Router is removed from the ApplicationService, the double instantiation is gone.
Can't understand why, so I'll wait for a better answer for approving.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The reason for this is that once you include Router
in dependencies to your APP_INITIALIZER
factory you get circular dependency (https://github.com/angular/angular/blob/4c2ce4e8ba4c5ac5ce8754d67bc6603eaad4564a/packages/router/src/router_module.ts#L61-L64).
ApplicationService
|
TestService
|
Router
|
ApplicationRef
|
ApplicationInitStatus
|
APP_INITIALIZER
|
ApplicationService
To solve this you can get Router lazily:
export class TestService {
get router() {
return this.injector.get(Router)
}
constructor(private _http: HttpClient, private injector: Injector ) {
}
}
Forked Stackblitz
add a comment |
up vote
0
down vote
accepted
The reason for this is that once you include Router
in dependencies to your APP_INITIALIZER
factory you get circular dependency (https://github.com/angular/angular/blob/4c2ce4e8ba4c5ac5ce8754d67bc6603eaad4564a/packages/router/src/router_module.ts#L61-L64).
ApplicationService
|
TestService
|
Router
|
ApplicationRef
|
ApplicationInitStatus
|
APP_INITIALIZER
|
ApplicationService
To solve this you can get Router lazily:
export class TestService {
get router() {
return this.injector.get(Router)
}
constructor(private _http: HttpClient, private injector: Injector ) {
}
}
Forked Stackblitz
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The reason for this is that once you include Router
in dependencies to your APP_INITIALIZER
factory you get circular dependency (https://github.com/angular/angular/blob/4c2ce4e8ba4c5ac5ce8754d67bc6603eaad4564a/packages/router/src/router_module.ts#L61-L64).
ApplicationService
|
TestService
|
Router
|
ApplicationRef
|
ApplicationInitStatus
|
APP_INITIALIZER
|
ApplicationService
To solve this you can get Router lazily:
export class TestService {
get router() {
return this.injector.get(Router)
}
constructor(private _http: HttpClient, private injector: Injector ) {
}
}
Forked Stackblitz
The reason for this is that once you include Router
in dependencies to your APP_INITIALIZER
factory you get circular dependency (https://github.com/angular/angular/blob/4c2ce4e8ba4c5ac5ce8754d67bc6603eaad4564a/packages/router/src/router_module.ts#L61-L64).
ApplicationService
|
TestService
|
Router
|
ApplicationRef
|
ApplicationInitStatus
|
APP_INITIALIZER
|
ApplicationService
To solve this you can get Router lazily:
export class TestService {
get router() {
return this.injector.get(Router)
}
constructor(private _http: HttpClient, private injector: Injector ) {
}
}
Forked Stackblitz
answered Nov 14 at 18:40
yurzui
91k10176199
91k10176199
add a comment |
add a comment |
up vote
1
down vote
Based on your Explanation that you have added the providedIn: root
in the application.service.ts
, that means it will be added to the root module (i.e Appmodule.ts) and again in the Appmodule.ts
in your provider
array you are adding ApplicationService
.
From this Blog its state that
"There is now a new, recommended, way to register a provider, directly
inside the @Injectable() decorator, using the new providedIn
attribute. It accepts 'root' as a value or any module of your
application. When you use 'root', your injectable will be registered
as a singleton in the application, and you don’t need to add it to the
providers of the root module. Similarly, if you use providedIn:
UsersModule, the injectable is registered as a provider of the
UsersModule without adding it to the providers of the module."
this is creating the service to be reinstantiated
Edit1 :
Another thing to check is ,
1. How are you calling this service i mean in Dev mode or Prod mode , if its dev mode then service will be called twice
If you're running in development mode, it will run the function at
least twice. since in development mode it does a check, changes, then
rechecks to verify, where production mode only does the first check,
assuming you've done your quality assurance and resolved any values
the get changed post checking.
Source
Try to check in Prod Mode and verify it..
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
|
show 4 more comments
up vote
1
down vote
Based on your Explanation that you have added the providedIn: root
in the application.service.ts
, that means it will be added to the root module (i.e Appmodule.ts) and again in the Appmodule.ts
in your provider
array you are adding ApplicationService
.
From this Blog its state that
"There is now a new, recommended, way to register a provider, directly
inside the @Injectable() decorator, using the new providedIn
attribute. It accepts 'root' as a value or any module of your
application. When you use 'root', your injectable will be registered
as a singleton in the application, and you don’t need to add it to the
providers of the root module. Similarly, if you use providedIn:
UsersModule, the injectable is registered as a provider of the
UsersModule without adding it to the providers of the module."
this is creating the service to be reinstantiated
Edit1 :
Another thing to check is ,
1. How are you calling this service i mean in Dev mode or Prod mode , if its dev mode then service will be called twice
If you're running in development mode, it will run the function at
least twice. since in development mode it does a check, changes, then
rechecks to verify, where production mode only does the first check,
assuming you've done your quality assurance and resolved any values
the get changed post checking.
Source
Try to check in Prod Mode and verify it..
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
|
show 4 more comments
up vote
1
down vote
up vote
1
down vote
Based on your Explanation that you have added the providedIn: root
in the application.service.ts
, that means it will be added to the root module (i.e Appmodule.ts) and again in the Appmodule.ts
in your provider
array you are adding ApplicationService
.
From this Blog its state that
"There is now a new, recommended, way to register a provider, directly
inside the @Injectable() decorator, using the new providedIn
attribute. It accepts 'root' as a value or any module of your
application. When you use 'root', your injectable will be registered
as a singleton in the application, and you don’t need to add it to the
providers of the root module. Similarly, if you use providedIn:
UsersModule, the injectable is registered as a provider of the
UsersModule without adding it to the providers of the module."
this is creating the service to be reinstantiated
Edit1 :
Another thing to check is ,
1. How are you calling this service i mean in Dev mode or Prod mode , if its dev mode then service will be called twice
If you're running in development mode, it will run the function at
least twice. since in development mode it does a check, changes, then
rechecks to verify, where production mode only does the first check,
assuming you've done your quality assurance and resolved any values
the get changed post checking.
Source
Try to check in Prod Mode and verify it..
Based on your Explanation that you have added the providedIn: root
in the application.service.ts
, that means it will be added to the root module (i.e Appmodule.ts) and again in the Appmodule.ts
in your provider
array you are adding ApplicationService
.
From this Blog its state that
"There is now a new, recommended, way to register a provider, directly
inside the @Injectable() decorator, using the new providedIn
attribute. It accepts 'root' as a value or any module of your
application. When you use 'root', your injectable will be registered
as a singleton in the application, and you don’t need to add it to the
providers of the root module. Similarly, if you use providedIn:
UsersModule, the injectable is registered as a provider of the
UsersModule without adding it to the providers of the module."
this is creating the service to be reinstantiated
Edit1 :
Another thing to check is ,
1. How are you calling this service i mean in Dev mode or Prod mode , if its dev mode then service will be called twice
If you're running in development mode, it will run the function at
least twice. since in development mode it does a check, changes, then
rechecks to verify, where production mode only does the first check,
assuming you've done your quality assurance and resolved any values
the get changed post checking.
Source
Try to check in Prod Mode and verify it..
edited Nov 13 at 9:41
answered Nov 12 at 12:09
Webruster
7,26542138
7,26542138
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
|
show 4 more comments
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
If I remove the providedIn: root declaration, it still keeps being instantiated twice. Also, I can't remove it from the providers array because it's needed for the appServiceFactory function provided to APP_INITIALIZER
– lucgenti
Nov 12 at 13:23
2
2
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
@lucgenti it would be better if you can keep the code in slackblitz or any other means so that it will help in debugging more. right now we will be giving the solutions on case by case which is of no use
– Webruster
Nov 13 at 5:00
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
stackblitz.com/edit/angular-xwyugy but here seems like is getting instantiated just one time
– lucgenti
Nov 13 at 11:31
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
instead, in my app it keeps doing that even if enableProdMode();
– lucgenti
Nov 13 at 11:57
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
seems like the problem is not that the service is instantiated twice beacuse of dependency injection in a component. It's during the bootstrap that it's been called twice (1 for the module, 1 for the factory). So the data retrieved from the factory is lost.
– lucgenti
Nov 13 at 14:06
|
show 4 more comments
up vote
0
down vote
Found the problem: it was because of the Router, needed as dependency by a service injected in ApplicationService.
See example:
https://stackblitz.com/edit/angular-xwyugy
When Router is removed from the ApplicationService, the double instantiation is gone.
Can't understand why, so I'll wait for a better answer for approving.
add a comment |
up vote
0
down vote
Found the problem: it was because of the Router, needed as dependency by a service injected in ApplicationService.
See example:
https://stackblitz.com/edit/angular-xwyugy
When Router is removed from the ApplicationService, the double instantiation is gone.
Can't understand why, so I'll wait for a better answer for approving.
add a comment |
up vote
0
down vote
up vote
0
down vote
Found the problem: it was because of the Router, needed as dependency by a service injected in ApplicationService.
See example:
https://stackblitz.com/edit/angular-xwyugy
When Router is removed from the ApplicationService, the double instantiation is gone.
Can't understand why, so I'll wait for a better answer for approving.
Found the problem: it was because of the Router, needed as dependency by a service injected in ApplicationService.
See example:
https://stackblitz.com/edit/angular-xwyugy
When Router is removed from the ApplicationService, the double instantiation is gone.
Can't understand why, so I'll wait for a better answer for approving.
answered Nov 14 at 8:41
lucgenti
13212
13212
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53226116%2fservice-instantiated-twice-after-app-initializer%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you show use how you're importing module?
– Pankaj Parkar
Nov 9 at 13:04
@PankajParkar added
– lucgenti
Nov 9 at 13:15
I mean to say how you are importing module inside NgModule's
imports
array. this module is loaded lazily or eagerly?– Pankaj Parkar
Nov 9 at 13:32
@PankajParkar the service is loaded inside the root module. I'm using only 1 module.
– lucgenti
Nov 9 at 13:34
what is
appServiceFactory
, I don't see that function anywhere in the code.– Pankaj Parkar
Nov 9 at 13:39