Prototype of a Material Design Datepicker Component for Angular 2
npm install angular-material-datepickerbash
npm install angular-material-datepicker
npm install @angular/material
`
$3
`typescript
import { MaterialModule } from '@angular/material';
import { DatePickerModule } from 'angular-material-datepicker';
...
@NgModule({
imports: [
MaterialModule.forRoot(),
DatePickerModule,
...
],
...
})
export class YourModule { }
`
$3
Import themes and apply them to the Calendar in your style.scss.
`scss
// Import a pre-built theme
@import '~@angular/material/core/theming/prebuilt/deeppurple-amber';
// Import your custom input theme file so you can call the custom-input-theme function
@import '~angular-material-datepicker/src/datepicker/calendar.component.scss';
// Using the $theme variable from the pre-built theme you can call the theming function
@include calendar-theme($theme);
`
Usage
$3
`html
`
$3
You can use two-way-binding to set and get and selected value of the Datepicker.
`html
`
Run Demo App
You can try out the Datepicker in the demo app built with Angular-CLI.
$3
$3
`bash
npm install -g angular-cli@latest
`
$3
`bash
npm install
`
$3
`bash
ng serve
``