diff --git a/README.md b/README.md index 3721bab..bed7b9c 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,13 @@ ## 💕 Examples -> See branch gh-pages for all code of extant examples. +> See branch [gh-pages](https://github.com/hiyali/ng-data-picker/tree/gh-pages) for all code of extant examples and environment. -Link: [demo](https://hiyali.github.io/ng-data-picker/docs/) +| Demo | Level | Code | +| :-------- | :--------- | :-------- | +| [gender](https://hiyali.github.io/ng-data-picker/docs/#/gender) | 1 | [gender](https://github.com/hiyali/ng-data-picker/tree/gh-pages/src/app/gender) | +| [product](https://hiyali.github.io/ng-data-picker/docs/#/product) | 2 | [product](https://github.com/hiyali/ng-data-picker/tree/gh-pages/src/app/product) | +| [date-time](https://hiyali.github.io/ng-data-picker/docs/#/date-time) | 3 | [date-time](https://github.com/hiyali/ng-data-picker/tree/gh-pages/src/app/date-time) | ## 🤠 Take a look @@ -75,7 +79,7 @@ export class AppComponent { ## ⚙️ Props -| name | type | default | explain | +| name | type | default | explain | | :------------------------- | :--------- | :------------ | :------------------------------- | | `change` | `Function` | ({gIndex,iIndex})=>{} | Callback after which group's current index changed, pass two arguments, group index `gIndex` and item index `iIndex` | | `data` | `Array` | [] | Picker initial data | diff --git a/package.json b/package.json index 644b668..2db5c1e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ng-data-picker", "author": "Salam Hiyali", - "version": "0.1.3", + "version": "0.1.4", "description": "A data picker that like iOS native datetime picker based on Angular 4+", "license": "MIT", "main": "lib/data-picker.module", diff --git a/src/app/data-picker/data-picker/data-picker.component.ts b/src/app/data-picker/data-picker/data-picker.component.ts index 0961e44..7fae44d 100644 --- a/src/app/data-picker/data-picker/data-picker.component.ts +++ b/src/app/data-picker/data-picker/data-picker.component.ts @@ -180,12 +180,13 @@ export class DataPickerComponent implements OnInit, AfterViewInit, OnDestroy { this.lastCurrentIndexList = [].concat(this.currentIndexList) this.groupsRectList = new Array(this.data.length) + + this.eventsRegister() + window.addEventListener('resize', this.safeGetRectsBindEvents.bind(this)) } ngAfterViewInit() { - this.eventsRegister() this.getGroupsRectList() - window.addEventListener('resize', this.safeGetRectsBindEvents.bind(this)) } ngOnDestroy () {