ng-month
v1.0.4
Published
Month
Downloads
2
Maintainers
Readme
Month
This is a small json file which containes months.
month json file
A small utility month json file which is used to bind month in a select control.
Installation instruction
In this section, I am going to explain how to install and use ng-month package
npm install ng-month --save
Please follow below instruction to use the package
How to use?
// in your component where you want to bind months
var monthjson = require('ng-month/month.json');
// in your component ts file
ngOnInit(){
this.months = monthjson
}
// in your component html file
<select class="form-control" [(ngModel)]="modalname">
<option value="" selected disabled>Month</option>
<option *ngFor="let month of months;" value="{{month.value}}">{{month.month}}</option>
</select>
// or
<select class="form-control" [(ngModel)]="modalname">
<option value="" selected disabled>Month</option>
<option *ngFor="let month of months;" value="{{month.value}}">{{month.shortname}}</option>
</select>