@finlexlabs/snackbar
v0.0.2
Published
Library Name: finlex-snackbar Package Name: @finlexlabs/Snackbar Repo Name: fx-ng-components
Downloads
6
Readme
FinlexSnackbar (@finlexlabs/Snackbar)
Library Name: finlex-snackbar Package Name: @finlexlabs/Snackbar Repo Name: fx-ng-components
Steps to Build & Publish Library
Package Renaming
Go to src/finlex-snackbar/package.json
Rename package name from finlex-snackbar
to @finlexlabs/Snackbar
Build
npm run build:snackbar
It will build finlex-snackbar using ng-packagr.
The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with npm run build:snackbar
, go to the dist folder cd dist/finlex-snackbar
and run npm publish
.
Snackbar Component Usage
// /src/app/app.module.ts
import { SnackbarModule } from '@finlexlabs/snackbar';
@NgModule({
declarations: [AppComponent],
imports: [
SnackbarModule, // needed for centralized error handling
// other imports
]
bootstrap: [AppComponent]
})
export class AppModule { }
To add a link to snackbar
import { SnackbarService } from '@finlexlabs/snackbar';
constructor(private snackBarService: SnackbarService) {}
this.snackBarService.success('Title', 'Description goes here...', {
link: { label: 'Go to Google', url: 'http://www.google.com' }
});