angular-xyy
TypeScript icon, indicating that this package has built-in type declarations

0.3.5 • Public • Published

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({...});
}

Readme

Keywords

Package Sidebar

Install

npm i angular-xyy

Weekly Downloads

7

Version

0.3.5

License

MIT

Unpacked Size

664 kB

Total Files

451

Last publish

Collaborators

  • xiongyayun428