ng-snotify
![NPM Downloads](https://img.shields.io/npm/dt/ng-snotify.svg)
Example
https://artemsky.github.io/ng-snotify/
Features
- 8 types of toast notifications
- Flexible, Configurable
- Custom styling
- Lifecycle callbacks
- Fully CSS, no angular animations dependency!
Installation
NPM 5
npm install ng-snotify
NPM 4
npm install ng-snotify --save
Import Module
Import SnotifyModule, also you can try SnotifyModule.forRoot() if you have build errors
And provide SnotifyService
import { SnotifyModule, SnotifyService } from 'ng-snotify';
@NgModule({
imports: [
BrowserModule,
SnotifyModule
],
providers: [SnotifyService]
})
export class AppModule { }
Add selector
Add app-snotify
component to you root component
<app-snotify></app-snotify>
Dependency injection
Now you should inject SnotifyService
import {SnotifyService} from 'ng-snotify';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
constructor(private snotifyService: SnotifyService) {}
}
Documentation and Examples
Wiki - here
Examples - here
Example application source - here
Auto-Documentation - here
Development
npm run build
cd src
npm link
cd ..
npm link ng-snotify
- Run component build:watch
npm run build:watch
- Run example app
ng serve --open
- open
localhost:4200
in your browser - go to
./src
- Start developing!
Known issues
- Compodoc stopped generate interfaces - (source)
License
MIT © artemsky
Change Log
v1.3.0
- add Custom Styling - Read more
- fix max-height collapsing closeOnClick
v1.2.0
- add custom icons Wiki
You can see an example of custom icon by calling Simple toast in the example app
v1.1.7
- fix AOT compilation (#13)
v1.1.6
- Add callback text when No button pressed (Prompt)
- Improve documentation
- Create wiki
v1.1.4
- remove min-height (#11)
- fix max-height animation
- change 2-branches developing (develop\master) onto 1 branch (master)
- Upgrade example app angular cli 1.0.2 -> 1.1.0
- Upgrade yeomen generator-angular2-library 10.0.0 -> 10.2.2
v1.1.3
- fix TruncatePipe error (#9)
- fix box-sizing
v1.1.2
- fix async toast (#8)
- add
truncate
pipe - add toast
titleMaxLeght
and bodyMaxLeght
to SnotifyConfig
- add toast
maxHeight
to SnotifyOptions
(#7) - add body to prompt type and replace input preview text wih new option
placeholder
of SnotifyConfig
type
v1.0.0
Future
- rename component to
ng2-snotify
due semantic purpose