{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/9955","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/9955/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/9955/comments","events_url":"https://api.github.com/repos/angular/angular/issues/9955/events","html_url":"https://github.com/angular/angular/issues/9955","id":164833167,"number":9955,"title":"Change cycle is not triggered for array of object in component","user":{"login":"venkateswaris","id":1954791,"avatar_url":"https://avatars.githubusercontent.com/u/1954791?v=3","gravatar_id":"","url":"https://api.github.com/users/venkateswaris","html_url":"https://github.com/venkateswaris","followers_url":"https://api.github.com/users/venkateswaris/followers","following_url":"https://api.github.com/users/venkateswaris/following{/other_user}","gists_url":"https://api.github.com/users/venkateswaris/gists{/gist_id}","starred_url":"https://api.github.com/users/venkateswaris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venkateswaris/subscriptions","organizations_url":"https://api.github.com/users/venkateswaris/orgs","repos_url":"https://api.github.com/users/venkateswaris/repos","events_url":"https://api.github.com/users/venkateswaris/events{/privacy}","received_events_url":"https://api.github.com/users/venkateswaris/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-11T13:10:00Z","updated_at":"2016-07-11T13:23:19Z","closed_at":"2016-07-11T13:23:19Z","body":"When array of object is passed to component , changes in the array element(remove or add) is not reflected in html. But changing any property of any element is reflected.\r\n\r\nWe are passing list of cities to the component:\r\n          `  <list-city  [cities]=\"country.getCities()\"></list-cities>`\r\nin side the component, we are adding new city or removing city.\r\n\r\n`export class CityListComponent {\r\n    @Input cities: City[];\r\n    add = (city: City) => cities.push(city);\r\n}`\r\n\r\nin the CityListComponent templates, we are listing all the cities. When new city is added, it is **not reflected**. But if we change any property of the existing city, it is reflected.   \r\n\r\n* **Angular version:** 2.0.0-rc.3\r\n \r\n* **Language:** [ TypeScript ] \r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/231732488","html_url":"https://github.com/angular/angular/issues/9955#issuecomment-231732488","issue_url":"https://api.github.com/repos/angular/angular/issues/9955","id":231732488,"user":{"login":"pkozlowski-opensource","id":973550,"avatar_url":"https://avatars.githubusercontent.com/u/973550?v=3","gravatar_id":"","url":"https://api.github.com/users/pkozlowski-opensource","html_url":"https://github.com/pkozlowski-opensource","followers_url":"https://api.github.com/users/pkozlowski-opensource/followers","following_url":"https://api.github.com/users/pkozlowski-opensource/following{/other_user}","gists_url":"https://api.github.com/users/pkozlowski-opensource/gists{/gist_id}","starred_url":"https://api.github.com/users/pkozlowski-opensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkozlowski-opensource/subscriptions","organizations_url":"https://api.github.com/users/pkozlowski-opensource/orgs","repos_url":"https://api.github.com/users/pkozlowski-opensource/repos","events_url":"https://api.github.com/users/pkozlowski-opensource/events{/privacy}","received_events_url":"https://api.github.com/users/pkozlowski-opensource/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T13:23:19Z","updated_at":"2016-07-11T13:23:19Z","body":"This works as designed. By default ng2 is only observing references to values, not the object themselves. If you want to observe content of an object you need to do it on your side. Check [ngClass directive](https://github.com/angular/angular/blob/master/modules/@angular/common/src/directives/ng_class.ts#L109) for an example of doing so."}}
{"actor":{"display_login":"pkozlowski-opensource"}}