@ghd/core-ui
v6.0.11
Published
Core UI of GHD for Angular 6
Downloads
104
Readme
Angular Core UI
This package contains contains common UI components
Using this package:
Go to your Angular 6.X project and run this command:
> npm install @ghd/core-ui --save
import { GHDCoreUIModule } from '@ghd/core-ui';
// import UIModule to your base app.module or a shared module accross your app
@NgModule({
imports: [
GHDCoreUIModule
]
})
Package Exports:
Dialog Component:ng b
<ghd-dialog-confirm [opened]="true" [title]="'Please confirm'" [message]="'Are you sure?'"></ghd-dialog-confirm>
Toast/Alert/Notification Component:
Arguments:
message: (string) - REQUIRED: Your custom string message
timeout: (number) - OPTIONAL: Timeout in milliseconds to display alert message (default: 3000 milliseconds)
// import GHDAlertModule to your base app.module or a shared module accross your app
import { GHDAlertModule } from '@ghd/core-ui';
@NgModule({
imports: [
GHDAlertModule.forRoot()
]
})
// On your component, import the Alert Service
import { GHDAlertService } from '@ghd/core-ui';
// and inject it
...
export class MyComponent {
constructor(private alertService: GHDAlertService) {}
// then use it!
myFunction() {
this.alertService.success('Successfully Added Form', 5000);
...
this.alertService.error('Error Added Form', 10000);
...
this.alertService.warn('Warning, please resolve immediately');
}
}
System Requirements (optional: for building this package):
- Node v8.X.X (might as well use current stable v8.11.1 as of the current day of writing)
- npm v5.6.0
- rollup v0.58.2
To know more about packaging with npm and angular click here