angular-xyy
v0.3.5
Published
Angular 5+ for Components
Downloads
18
Readme
Angular 5+ for Components
基于Angular5+、TypeScript封装的小组件
预览
Setup
Download the library with npm
npm install --save angular-xyy
HttpModule
Import the HttpModule
in to your AppModule
Default:
@NgModule({
imports: [ HttpModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
User defined:
@NgModule({
imports: [ HttpModule.settings({ Transaction }) ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Using
constructor(private http: HttpService) { }
functionName() {
this.http.post(...);
}
NotificationsModule
Import the NotificationsModule
in to your AppModule
@NgModule({
imports: [ NotificationsModule.forRoot() ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Using
constructor(private notifications: NotificationsService) { }
functionName() {
this.notifications.success('title', 'content');
...
}
ConfirmDialogModule
Import the ConfirmDialogModule
in to your AppModule
@NgModule({
imports: [ ConfirmDialogModule.forRoot() ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Using
constructor(private confirmation: ConfirmationService) { }
functionName() {
this.confirmation.confirm({...});
}