
onst
MessageServiceFactory = () => {
if (environment.production) {
return new MessageService();
} else {
return new NewMessageService();
}
};
{
// ...
providers: [
{
provide: MessageService,
useFactory: MessageServiceFactory
}
]
}
onst
MessageServiceFactory = () => {
if (environment.production) {
return new MessageService();
} else {
return new NewMessageService();
}
};
{
// ...
providers: [
{
provide: MessageService,
useFactory: MessageServiceFactory
}
]
}