|
|
@ -3,25 +3,11 @@ import { BrowserModule } from '@angular/platform-browser'; |
|
|
|
import { FormsModule } from '@angular/forms'; |
|
|
|
|
|
|
|
import { AppComponent } from './app.component'; |
|
|
|
import { OrderService } from './order.service'; |
|
|
|
import { OrderAnniversaryService } from './order-anniversary.service'; |
|
|
|
import { CustomComponent } from './custom/custom.component'; |
|
|
|
|
|
|
|
@NgModule({ |
|
|
|
imports: [BrowserModule, FormsModule], |
|
|
|
declarations: [AppComponent], |
|
|
|
providers: [ |
|
|
|
{ |
|
|
|
provide: OrderService, |
|
|
|
useFactory: () => { |
|
|
|
const today = new Date(2020, 9, 3); |
|
|
|
if (today.getMonth() === 9) { |
|
|
|
return new OrderAnniversaryService(); |
|
|
|
} else { |
|
|
|
return new OrderService(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
bootstrap: [AppComponent], |
|
|
|
imports: [ BrowserModule, FormsModule ], |
|
|
|
declarations: [ AppComponent, CustomComponent ], |
|
|
|
bootstrap: [ AppComponent ] |
|
|
|
}) |
|
|
|
export class AppModule {} |
|
|
|
export class AppModule { } |