1.0.2 • Published 6 years ago
rw-datepicker v1.0.2
@redwagon/angular-material
Installation
To install this library, run:
$ yarn add @redwagon/angular-material --save
Consuming your library
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import your library
import { RWAngularMaterialModule } from '@redwagon/angular-material';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify your library as an import
RWAngularMaterialModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Include Material Style in your style file:
@import '~@angular/material/prebuilt-themes/indigo-pink.css';
Importing HammerJS for better experience with Angular Material modifiying the file: src/polyfills.ts:
import 'hammerjs/hammer';
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now use your library component in app.component.html -->
<h1>
{{title}}
</h1>
<rw-datepicker (update)="getDateRange($event)"></rw-datepicker>
Implement in your component a function to get value emited by component
getDateRange(event: object): void {
// Function to get values emited by component
}
Building library
To generate all *.js
, *.d.ts
and *.metadata.json
files:
$ yarn build.ngm
Publish library
To publish run:
$ yarn publish.lib
License
MIT © RedWagonInc.