Skip to content

Commit

Permalink
Update readme & fix some
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyali committed Nov 20, 2017
1 parent d3e6b0a commit 3b21028
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
5 changes: 3 additions & 2 deletions src/app/data-picker/data-picker/data-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 3b21028

Please sign in to comment.