{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular.js/issues/11514","labels_url":"https://api.github.com/repos/angular/angular.js/issues/11514/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/11514/comments","events_url":"https://api.github.com/repos/angular/angular.js/issues/11514/events","html_url":"https://github.com/angular/angular.js/issues/11514","id":66368966,"number":11514,"title":"Automatic update of $scope variable","user":{"login":"mishavetl","id":9119326,"avatar_url":"https://avatars.githubusercontent.com/u/9119326?v=3","gravatar_id":"","url":"https://api.github.com/users/mishavetl","html_url":"https://github.com/mishavetl","followers_url":"https://api.github.com/users/mishavetl/followers","following_url":"https://api.github.com/users/mishavetl/following{/other_user}","gists_url":"https://api.github.com/users/mishavetl/gists{/gist_id}","starred_url":"https://api.github.com/users/mishavetl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mishavetl/subscriptions","organizations_url":"https://api.github.com/users/mishavetl/orgs","repos_url":"https://api.github.com/users/mishavetl/repos","events_url":"https://api.github.com/users/mishavetl/events{/privacy}","received_events_url":"https://api.github.com/users/mishavetl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-04T21:15:07Z","updated_at":"2015-04-05T16:17:37Z","closed_at":null,"body":"If i use `{{ foo }}` in template and in controller\r\n`$scope.foo = 'bar';`\r\n\r\nIt does not update automaticly.\r\nI know that i can do as following:\r\n\r\n    $scope.get_foo = function (){\r\n        return $scope.foo;\r\n    }\r\n\r\nBut it will increase an amount of lines in my code.\r\n\r\nCan it be fixed or is there some issues?"},"comment":{"url":"https://api.github.com/repos/angular/angular.js/issues/comments/89798278","html_url":"https://github.com/angular/angular.js/issues/11514#issuecomment-89798278","issue_url":"https://api.github.com/repos/angular/angular.js/issues/11514","id":89798278,"user":{"login":"wesleycho","id":1703387,"avatar_url":"https://avatars.githubusercontent.com/u/1703387?v=3","gravatar_id":"","url":"https://api.github.com/users/wesleycho","html_url":"https://github.com/wesleycho","followers_url":"https://api.github.com/users/wesleycho/followers","following_url":"https://api.github.com/users/wesleycho/following{/other_user}","gists_url":"https://api.github.com/users/wesleycho/gists{/gist_id}","starred_url":"https://api.github.com/users/wesleycho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wesleycho/subscriptions","organizations_url":"https://api.github.com/users/wesleycho/orgs","repos_url":"https://api.github.com/users/wesleycho/repos","events_url":"https://api.github.com/users/wesleycho/events{/privacy}","received_events_url":"https://api.github.com/users/wesleycho/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T16:17:37Z","updated_at":"2015-04-05T16:17:37Z","body":"Likely what is happening is that the code that sets `$scope.foo = 'bar';` is outside the Angular context, and so the fix is likely to execute `$scope.$apply()` at the end of that block.\r\n\r\nAnother common issue is that you are using directives that create new `$scope` - I recommending reading [this entry on $scope](https://github.com/angular/angular.js/wiki/Understanding-Scopes), and setting this property to an object on `$scope`, i.e. `$scope.foo.bar = 'baz'`."}}