Angular 5+ for Components
npm install angular-xyy
npm install --save angular-xyy
`
$3
Import the HttpModule in to your AppModule
Default:
`ts
@NgModule({
imports: [ HttpModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
`
User defined:
`ts
@NgModule({
imports: [ HttpModule.settings({ Transaction }) ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
`
Using
`ts
constructor(private http: HttpService) { }
functionName() {
this.http.post(...);
}
`
$3
Import the NotificationsModule in to your AppModule
`ts
@NgModule({
imports: [ NotificationsModule.forRoot() ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
`
Using
`ts
constructor(private notifications: NotificationsService) { }
functionName() {
this.notifications.success('title', 'content');
...
}
`
$3
Import the ConfirmDialogModule in to your AppModule
`ts
@NgModule({
imports: [ ConfirmDialogModule.forRoot() ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
`
Using
`ts
constructor(private confirmation: ConfirmationService) { }
functionName() {
this.confirmation.confirm({...});
}
``