{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/3168","labels_url":"https://api.github.com/repos/angular/angular/issues/3168/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/3168/comments","events_url":"https://api.github.com/repos/angular/angular/issues/3168/events","html_url":"https://github.com/angular/angular/issues/3168","id":96204162,"number":3168,"title":"Bound CSSClass not replaced after router navigation","user":{"login":"thelgevold","id":349548,"avatar_url":"https://avatars.githubusercontent.com/u/349548?v=3","gravatar_id":"","url":"https://api.github.com/users/thelgevold","html_url":"https://github.com/thelgevold","followers_url":"https://api.github.com/users/thelgevold/followers","following_url":"https://api.github.com/users/thelgevold/following{/other_user}","gists_url":"https://api.github.com/users/thelgevold/gists{/gist_id}","starred_url":"https://api.github.com/users/thelgevold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelgevold/subscriptions","organizations_url":"https://api.github.com/users/thelgevold/orgs","repos_url":"https://api.github.com/users/thelgevold/repos","events_url":"https://api.github.com/users/thelgevold/events{/privacy}","received_events_url":"https://api.github.com/users/thelgevold/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/effort2:%20medium%20(day)","name":"effort2: medium (day)","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular/labels/P2:%20required","name":"P2: required","color":"fad8c7"},{"url":"https://api.github.com/repos/angular/angular/labels/type:%20bug","name":"type: bug","color":"EEEEEE"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-07-21T01:22:11Z","updated_at":"2015-07-24T11:10:27Z","closed_at":"2015-07-23T23:55:16Z","body":"I have noticed that a bound CssClass value is not updated after router navigation. The old value is not replaced by the new value during data binding. Instead it leaves the existing one behind and adds the new one next to it when it's rebound.\r\n\r\nI am updating the class via a function which works ok on click, but for some reason the class is not replaced when navigating using the new router.\r\n\r\nElement:\r\n```<a (click)=\"selectComponent('grid')\"  [class]=\"getActiveClass('grid')\" class=\"list-group-item\">Link</a>```\r\n//Class is updated correctly when initiated via click, but not via router navigation.\r\n\r\nYou can see the behavior here: http://www.syntaxsuccess.com/angular-2-samples\r\n\r\nRepro steps:\r\n\r\nSuccessful:\r\nClick the left nav and see the active link update correctly (bootstrap blue active clas). \r\n\r\nFailure:\r\nSelect any of the left nav links other than the first element\r\nClick the 'About' link in the top navigation\r\nClick the 'Demo' link in the top navigation\r\nObserve that there are two highlighted links in the left nav.\r\nAfter debugging it I noticed that the correct functions fire, but the class property is not overwritten by the binding.\r\n\r\nSource code can be found here: https://github.com/thelgevold/angular-2-samples\r\n "},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/124477205","html_url":"https://github.com/angular/angular/issues/3168#issuecomment-124477205","issue_url":"https://api.github.com/repos/angular/angular/issues/3168","id":124477205,"user":{"login":"thelgevold","id":349548,"avatar_url":"https://avatars.githubusercontent.com/u/349548?v=3","gravatar_id":"","url":"https://api.github.com/users/thelgevold","html_url":"https://github.com/thelgevold","followers_url":"https://api.github.com/users/thelgevold/followers","following_url":"https://api.github.com/users/thelgevold/following{/other_user}","gists_url":"https://api.github.com/users/thelgevold/gists{/gist_id}","starred_url":"https://api.github.com/users/thelgevold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thelgevold/subscriptions","organizations_url":"https://api.github.com/users/thelgevold/orgs","repos_url":"https://api.github.com/users/thelgevold/repos","events_url":"https://api.github.com/users/thelgevold/events{/privacy}","received_events_url":"https://api.github.com/users/thelgevold/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T11:10:27Z","updated_at":"2015-07-24T11:10:27Z","body":"Thanks!"}}