{"action":"created","issue":{"url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/347","repository_url":"https://api.github.com/repos/swimlane/angular2-data-table","labels_url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/347/comments","events_url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/347/events","html_url":"https://github.com/swimlane/angular2-data-table/issues/347","id":193731098,"number":347,"title":"Use Async pipe like rxDemo example and show error: Cannot read property 'length' of null","user":{"login":"h4mit","id":4971751,"avatar_url":"https://avatars.githubusercontent.com/u/4971751?v=3","gravatar_id":"","url":"https://api.github.com/users/h4mit","html_url":"https://github.com/h4mit","followers_url":"https://api.github.com/users/h4mit/followers","following_url":"https://api.github.com/users/h4mit/following{/other_user}","gists_url":"https://api.github.com/users/h4mit/gists{/gist_id}","starred_url":"https://api.github.com/users/h4mit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h4mit/subscriptions","organizations_url":"https://api.github.com/users/h4mit/orgs","repos_url":"https://api.github.com/users/h4mit/repos","events_url":"https://api.github.com/users/h4mit/events{/privacy}","received_events_url":"https://api.github.com/users/h4mit/received_events","type":"User","site_admin":false},"labels":[{"id":385491621,"url":"https://api.github.com/repos/swimlane/angular2-data-table/labels/Bug","name":"Bug","color":"ee0701","default":false},{"id":403504504,"url":"https://api.github.com/repos/swimlane/angular2-data-table/labels/Investigate","name":"Investigate","color":"fbca04","default":false},{"id":493824016,"url":"https://api.github.com/repos/swimlane/angular2-data-table/labels/Priority:%20Med","name":"Priority: Med","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-06T10:08:39Z","updated_at":"2016-12-06T15:30:02Z","closed_at":null,"body":" use async pipe in the package version 2.1.3 show error my project.\r\n\r\n[ ] bug report =>\r\n code : \r\n```\r\nrows: Observable<ContactBook[]>;\r\n\r\n  constructor(private cgService: ContactBookService) {\r\n  }\r\n\r\n  ngOnInit(): void {\r\n    this.rows = this.cgService.getContactBooks();\r\n  }\r\n``` \r\ntemplate : \r\n```\r\n<swui-datatable\r\n          class=\"material\"\r\n          [rows]=\"rows | async\"\r\n          [columnMode]=\"'force'\"\r\n          [headerHeight]=\"50\"\r\n          [footerHeight]=\"50\"\r\n          [rowHeight]=\"'auto'\"\r\n          [limit]=\"10\">\r\n    <swui-datatable-column name=\"name\">\r\n      <template let-column=\"column\" swui-datatable-header-template>\r\n         {{column.name}}\r\n      </template>\r\n      <template let-value=\"value\" swui-datatable-cell-template>\r\n       <strong>{{value}}</strong>\r\n      </template>\r\n    </swui-datatable-column>\r\n    <swui-datatable-column name=\"type\">\r\n      <template let-column=\"column\" swui-datatable-header-template>\r\n         {{column.name}}\r\n      </template>\r\n      <template let-value=\"value\" swui-datatable-cell-template>\r\n        <strong>{{'CONTACT_GROUP.'+value | translate}}</strong>\r\n      </template>\r\n    </swui-datatable-column>\r\n  </swui-datatable>\r\n```\r\n\r\nerror : \r\n```\r\n core.umd.js:3004 EXCEPTION: Uncaught (in promise): Error: Error in ./DatatableComponent class DatatableComponent - inline template:15:8 caused by: Cannot read property 'length' of null\r\nTypeError: Cannot read property 'length' of null\r\n    at DatatableComponent.get [as allRowsSelected] (http://localhost:3000/node_modules/angular2-data-table/release/index.js:2174:54)\r\n    at _View_DatatableComponent1.detectChangesInternal (/Angular2DataTableModule/DatatableComponent/component.ngfactory.js:330:42)\r\n    at _View_DatatableComponent1.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9305:18)\r\n    at _View_DatatableComponent1.DebugAppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9410:48)\r\n    at _View_DatatableComponent0.AppView.detectContentChildrenChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9323:23)\r\n    at _View_DatatableComponent0.detectChangesInternal (/Angular2DataTableModule/DatatableComponent/component.ngfactory.js:192:8)\r\n    at _View_DatatableComponent0.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9305:18)\r\n    at _View_DatatableComponent0.DebugAppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9410:48)\r\n    at _View_ContactGroup0.AppView.detectViewChildrenChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9331:23)\r\n    at _View_ContactGroup0.detectChangesInternal (/PageModule/ContactGroup/component.ngfactory.js:203:8)ErrorHandler.handleError @ core.umd.js:3004next @ core.umd.js:6654schedulerFn @ core.umd.js:5952SafeSubscriber.__tryOrUnsub @ Subscriber.ts:238SafeSubscriber.next @ Subscriber.ts:190Subscriber._next @ Subscriber.ts:135Subscriber.next @ Subscriber.ts:95Subject.next @ Subject.ts:61EventEmitter.emit @ core.umd.js:5944NgZone.triggerError @ core.umd.js:6248onHandleError @ core.umd.js:6227ZoneDelegate.handleError @ zone.js:236Zone.runGuarded @ zone.js:131_loop_1 @ zone.js:412drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339\r\ncore.umd.js:3009 ORIGINAL STACKTRACE:ErrorHandler.handleError @ core.umd.js:3009next @ core.umd.js:6654schedulerFn @ core.umd.js:5952SafeSubscriber.__tryOrUnsub @ Subscriber.ts:238SafeSubscriber.next @ Subscriber.ts:190Subscriber._next @ Subscriber.ts:135Subscriber.next @ Subscriber.ts:95Subject.next @ Subject.ts:61EventEmitter.emit @ core.umd.js:5944NgZone.triggerError @ core.umd.js:6248onHandleError @ core.umd.js:6227ZoneDelegate.handleError @ zone.js:236Zone.runGuarded @ zone.js:131_loop_1 @ zone.js:412drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339\r\ncore.umd.js:3010 Error: Uncaught (in promise): Error: Error in ./DatatableComponent class DatatableComponent - inline template:15:8 caused by: Cannot read property 'length' of null\r\nTypeError: Cannot read property 'length' of null\r\n    at DatatableComponent.get [as allRowsSelected] (datatable.component.ts:653)\r\n    at _View_DatatableComponent1.detectChangesInternal (component.ngfactory.js:330)\r\n    at _View_DatatableComponent1.AppView.detectChanges (core.umd.js:9305)\r\n    at _View_DatatableComponent1.DebugAppView.detectChanges (core.umd.js:9410)\r\n    at _View_DatatableComponent0.AppView.detectContentChildrenChanges (core.umd.js:9323)\r\n    at _View_DatatableComponent0.detectChangesInternal (component.ngfactory.js:192)\r\n    at _View_DatatableComponent0.AppView.detectChanges (core.umd.js:9305)\r\n    at _View_DatatableComponent0.DebugAppView.detectChanges (core.umd.js:9410)\r\n    at _View_ContactGroup0.AppView.detectViewChildrenChanges (core.umd.js:9331)\r\n    at _View_ContactGroup0.detectChangesInternal (component.ngfactory.js:203)\r\n    at resolvePromise (zone.js:468)\r\n    at zone.js:445\r\n    at ZoneDelegate.invoke (zone.js:232)\r\n    at Object.onInvoke (core.umd.js:6206)\r\n    at ZoneDelegate.invoke (zone.js:231)\r\n    at Zone.run (zone.js:114)\r\n    at zone.js:502\r\n    at ZoneDelegate.invokeTask (zone.js:265)\r\n    at Object.onInvokeTask (core.umd.js:6197)\r\n    at ZoneDelegate.invokeTask (zone.js:264)ErrorHandler.handleError @ core.umd.js:3010next @ core.umd.js:6654schedulerFn @ core.umd.js:5952SafeSubscriber.__tryOrUnsub @ Subscriber.ts:238SafeSubscriber.next @ Subscriber.ts:190Subscriber._next @ Subscriber.ts:135Subscriber.next @ Subscriber.ts:95Subject.next @ Subject.ts:61EventEmitter.emit @ core.umd.js:5944NgZone.triggerError @ core.umd.js:6248onHandleError @ core.umd.js:6227ZoneDelegate.handleError @ zone.js:236Zone.runGuarded @ zone.js:131_loop_1 @ zone.js:412drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339\r\nzone.js:388 Unhandled Promise rejection: Error in ./DatatableComponent class DatatableComponent - inline template:15:8 caused by: Cannot read property 'length' of null ; Zone: angular ; Task: Promise.then ; Value: ViewWrappedError {_nativeError: Error: Error in ./DatatableComponent class DatatableComponent - inline template:15:8 caused by: Cann…, originalError: TypeError: Cannot read property 'length' of null\r\n    at DatatableComponent.get [as allRowsSelected] …, context: DebugContext} TypeError: Cannot read property 'length' of null\r\n    at DatatableComponent.get [as allRowsSelected] (http://localhost:3000/node_modules/angular2-data-table/release/index.js:2174:54)\r\n    at _View_DatatableComponent1.detectChangesInternal (/Angular2DataTableModule/DatatableComponent/component.ngfactory.js:330:42)\r\n    at _View_DatatableComponent1.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9305:18)\r\n    at _View_DatatableComponent1.DebugAppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9410:48)\r\n    at _View_DatatableComponent0.AppView.detectContentChildrenChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9323:23)\r\n    at _View_DatatableComponent0.detectChangesInternal (/Angular2DataTableModule/DatatableComponent/component.ngfactory.js:192:8)\r\n    at _View_DatatableComponent0.AppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9305:18)\r\n    at _View_DatatableComponent0.DebugAppView.detectChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9410:48)\r\n    at _View_ContactGroup0.AppView.detectViewChildrenChanges (http://localhost:3000/node_modules/@angular/core/bundles/core.umd.js:9331:23)\r\n    at _View_ContactGroup0.detectChangesInternal (/PageModule/ContactGroup/component.ngfactory.js:203:8)consoleError @ zone.js:388_loop_1 @ zone.js:417drainMicroTaskQueue @ zone.js:421ZoneTask.invoke @ zone.js:339\r\nzone.js:390 Error: Uncaught (in promise): Error: Error in ./DatatableComponent class DatatableComponent - inline template:15:8 caused by: Cannot read property 'length' of null(…)\r\n```\r\n```\r\n\r\n* **Table version:**2.1.3\r\n\r\n* **Angular version:** 2.2.1\r\n\r\n* **Browser:** [ Chrome XX | Firefox XX ]\r\n\r\n* **Language:** [TypeScript 2.0.10 ]\r\n"},"comment":{"url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/comments/265179604","html_url":"https://github.com/swimlane/angular2-data-table/issues/347#issuecomment-265179604","issue_url":"https://api.github.com/repos/swimlane/angular2-data-table/issues/347","id":265179604,"user":{"login":"Alex-Tsyganok","id":5132633,"avatar_url":"https://avatars.githubusercontent.com/u/5132633?v=3","gravatar_id":"","url":"https://api.github.com/users/Alex-Tsyganok","html_url":"https://github.com/Alex-Tsyganok","followers_url":"https://api.github.com/users/Alex-Tsyganok/followers","following_url":"https://api.github.com/users/Alex-Tsyganok/following{/other_user}","gists_url":"https://api.github.com/users/Alex-Tsyganok/gists{/gist_id}","starred_url":"https://api.github.com/users/Alex-Tsyganok/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alex-Tsyganok/subscriptions","organizations_url":"https://api.github.com/users/Alex-Tsyganok/orgs","repos_url":"https://api.github.com/users/Alex-Tsyganok/repos","events_url":"https://api.github.com/users/Alex-Tsyganok/events{/privacy}","received_events_url":"https://api.github.com/users/Alex-Tsyganok/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T15:30:02Z","updated_at":"2016-12-06T15:30:02Z","body":"Got same error, can be reproduced on demo page [http://swimlane.github.io/angular2-data-table/#](http://swimlane.github.io/angular2-data-table/# ) in Basic RxJS example.\r\n`polyfills.js:1100 TypeError: Cannot read property 'length' of null\r\n    at e.get [as allRowsSelected] (app.js:4)\r\n    at View_e1.detectChangesInternal (component.ngfactory.js:223)\r\n    at View_e1.e.detectChanges (polyfills.js:1226)\r\n    at e.detectChangesInNestedViews (polyfills.js:1233)\r\n    at proxyViewClass.View_e0.detectChangesInternal (component.ngfactory.js:121)\r\n    at proxyViewClass.e.detectChanges (polyfills.js:1226)\r\n    at proxyViewClass.View_e0.detectChangesInternal (component.ngfactory.js:75)\r\n    at proxyViewClass.e.detectChanges (polyfills.js:1226)\r\n    at View_e12.detectChangesInternal (component.ngfactory.js:1697)\r\n    at View_e12.e.detectChanges (polyfills.js:1226)`\r\n\r\nLooks like problem is here, because rows treated as array, but is't Observable<any[]> \r\n`/**\r\n         * Returns if all rows are selected.\r\n         *\r\n         * @readonly\r\n         * @private\r\n         * @type {boolean}\r\n         * @memberOf DatatableComponent\r\n         */\r\n        get: function () {\r\n            return this.selected.length === this.rows.length;\r\n        }`"}}
{"actor":{"display_login":"Alex-Tsyganok"}}