week-slider
v0.0.10
Published
Javascript library to display and select date from week slider.
Downloads
12
Readme
WeekSlider
Javascript library to display and select date from week slider.
Installation
npm i week-slider
Usage
- In 'tsconfig.json' add "allowSyntheticDefaultImports":true in compilerOptions.
"compilerOptions": {
"allowSyntheticDefaultImports":true
}
2)In app.module.ts, import WeekSliderModule.
import { WeekSliderModule } from 'week-slider';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
AppRoutingModule,
WeekSliderModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
3)Use template in component.html
<lib-week-slider></lib-week-slider>
Data and Event binding
- Set selectedDate:
<lib-week-slider [selectedDate]="date"></lib-week-slider>
2)Get selected date through event:
<lib-week-slider (selectDateEvent)="getEvent($event)"></lib-week-slider>