DEMO: https://yaseern.github.io/awesomeAngular/year
Latest version available for all version of Angular
npm install ngy-year-picker
- If you are using angular-cli you can add it to your angular.json
"styles": [
"styles.scss",
"node_modules/bootstrap/dist/css/bootstrap.min.css" // try adding '../' if you're using bootstrap
]
step 1: add NgYasYearPickerModule to app NgModule or import to the shared module
import { CommonModule } from '@angular/common';
import { NgYasYearPickerModule } from 'ngy-year-picker/ngy-year-picker';
@NgModule({
imports: [
CommonModule,
NgYasYearPickerModule// NgYasYearPickerModule added
],
bootstrap: [AppComponent],
declarations: [AppComponent]
})
class AppModule {}
<ngy-year-picker [(ngModel)]="model1" (change)="onChangeDoSomething1()" id="year-picker1"></ngy-year-picker>
<ngy-year-picker [(ngModel)]="model2" (change)="onChangeDoSomething2()" id="year-picker2" [isQuarterYear]="true"></ngy-year-picker>
Option | Type | Default | Description |
---|---|---|---|
isRequired | boolean | false | If field is required then this should set true |
isQuarterYear | boolean | false | This should set true If you want to show Quarter year picker ('Q1', 'Q2', 'Q3', 'Q4') |
fieldName | string | empty | This name is name attribure in tag (ex: ) |
isDisabled | boolean | false | If field disabled then this should set true |
MIT
GitHub @Yaseern ·