2.1.3 • Published 2 years ago

@pascaliske/ngx-notifications v2.1.3

Weekly downloads
95
License
MIT
Repository
github
Last release
2 years ago

@pascaliske/ngx-notifications

npm (scoped) GitHub Tag Build Status Dependabot Status Awesome Badges

Installation

To install the module use the following command:

$ ng add @pascaliske/ngx-notifications

Usage

  1. Import the module into your AppModule:

    import { NgModule } from '@angular/core'
    import { BrowserModule } from '@angular/platform-browser'
    import { NotificationsModule } from '@pascaliske/ngx-notifications'
    import { AppComponent } from './app.component'
    
    @NgModule({
        bootstrap: [AppComponent],
        declarations: [AppComponent],
        imports: [BrowserModule, NotificationsModule.forRoot()],
        providers: [],
    })
    export class AppModule {}
  2. Add the following line to your app's template:

    <cmp-notifications></cmp-notifications>
  3. Access the NotificationsService in your components:

    import { Component, OnInit } from '@angular/core'
    import { NotificationsService } from '@pascaliske/ngx-notifications'
    
    @Component({
        selector: 'cmp-root',
        templateUrl: './app.component.html',
        styleUrls: ['./app.component.scss'],
    })
    export class AppComponent implements OnInit {
        public constructor(private notificationService: NotificationsService) {}
    
        public ngOnInit(): void {
            this.notificationService.info('Hello World!')
        }
    }
  4. Style the notifications with your own styles:

    .cmp-notifications {
        // the notifications list
    }
    
    .cmp-notification {
        // a single notification
    
        &--info {
            // info styles
        }
    
        &--success {
            // success styles
        }
    
        &--warning {
            // warning styles
        }
    
        &--error {
            // error styles
        }
    }

License

MIT © Pascal Iske

2.1.2

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.1

3 years ago

1.5.2

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.2

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.11

5 years ago

1.0.10

6 years ago

1.0.8

6 years ago

1.0.9

6 years ago

1.0.7

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago