{"action":"created","issue":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1105","repository_url":"https://api.github.com/repos/Urigo/angular-meteor","labels_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1105/labels{/name}","comments_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1105/comments","events_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1105/events","html_url":"https://github.com/Urigo/angular-meteor/issues/1105","id":126952399,"number":1105,"title":"getReactively doesn't work properly with directive scope","user":{"login":"Deadly0","id":4887213,"avatar_url":"https://avatars.githubusercontent.com/u/4887213?v=3","gravatar_id":"","url":"https://api.github.com/users/Deadly0","html_url":"https://github.com/Deadly0","followers_url":"https://api.github.com/users/Deadly0/followers","following_url":"https://api.github.com/users/Deadly0/following{/other_user}","gists_url":"https://api.github.com/users/Deadly0/gists{/gist_id}","starred_url":"https://api.github.com/users/Deadly0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Deadly0/subscriptions","organizations_url":"https://api.github.com/users/Deadly0/orgs","repos_url":"https://api.github.com/users/Deadly0/repos","events_url":"https://api.github.com/users/Deadly0/events{/privacy}","received_events_url":"https://api.github.com/users/Deadly0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Urigo/angular-meteor/labels/More%20info%20needed","name":"More info needed","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Urigo/angular-meteor/milestones/7","html_url":"https://github.com/Urigo/angular-meteor/milestones/1.3.6-beta.1","labels_url":"https://api.github.com/repos/Urigo/angular-meteor/milestones/7/labels","id":1555730,"number":7,"title":"1.3.6-beta.1","description":"Cleanups and documentation for 1.3.\r\n\r\nWork is being done in https://github.com/ozsay/angular-meteor/tree/1.3.6\r\n\r\nIncludes @DAB0mB 's refactoring without changing APIs.\r\n- Current refactoring - https://github.com/DAB0mB/angular-meteor/tree/1.4.x\r\n- Current refactoring - https://github.com/urigo/angular-meteor/tree/v1.4.x\r\n\r\n* Branch 1.3.6 from master\r\n* Manually merge compatible branch into 1.3.6 (https://github.com/DAB0mB/angular-meteor/tree/compatible/v1.4.x)\r\n* Replaces reactive-context and reactive-scope to the new changes\r\n* Update that branch so that it will include all the changes from from https://github.com/urigo/angular-meteor/tree/v1.4.x like getCollectionReactively and maybe more?\r\n* Make sure to keep angular-meteor 1.2 legacy code\r\n* Include all recent changes in master\r\n* Run angular-meteor-socially on 1.3.6 and everything works perfectly\r\n* Check all existing issues and see that they are answered\r\n* Release beta to let people test it\r\n","creator":{"login":"Urigo","id":1297448,"avatar_url":"https://avatars.githubusercontent.com/u/1297448?v=3","gravatar_id":"","url":"https://api.github.com/users/Urigo","html_url":"https://github.com/Urigo","followers_url":"https://api.github.com/users/Urigo/followers","following_url":"https://api.github.com/users/Urigo/following{/other_user}","gists_url":"https://api.github.com/users/Urigo/gists{/gist_id}","starred_url":"https://api.github.com/users/Urigo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Urigo/subscriptions","organizations_url":"https://api.github.com/users/Urigo/orgs","repos_url":"https://api.github.com/users/Urigo/repos","events_url":"https://api.github.com/users/Urigo/events{/privacy}","received_events_url":"https://api.github.com/users/Urigo/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":5,"state":"open","created_at":"2016-02-01T14:25:22Z","updated_at":"2016-02-07T14:52:32Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2016-01-15T20:28:13Z","updated_at":"2016-02-07T16:59:01Z","closed_at":null,"body":"In `subscribe` `getReactively` will be called only once with initial value. When `filter` changed nothing happened with subscription.\r\n\r\nIf use getReactively without deep watch it will throw error when `filter` changed.\r\n![2016-01-15_232531](https://cloud.githubusercontent.com/assets/4887213/12364402/6595d322-bbdf-11e5-8752-f8816d8f4a0b.png)\r\n\r\n```\r\nangular.module('app').directive('myDirective', function() {\r\n  return {\r\n    restrict: 'E',\r\n    templateUrl: 'template.html',\r\n    replace: true,\r\n    scope: {\r\n      filter: '='\r\n    },\r\n    link: function($scope) {\r\n      $scope.subscribe('oddsPortalPicks', function() {\r\n        return [$scope.getReactively('filter', true)]; // Will be called only once\r\n      });\r\n      return $scope.autorun(function() {\r\n        console.log($scope.getReactively('filter')); // Will throw error \"TypeError: Cannot read property 'changed' of undefined\"\r\n      });\r\n    }\r\n  };\r\n});\r\n```\r\n\r\nIs directive scope not a reactive context or this is a bug?\r\n\r\nAlso after updating from 1.3.4 to 1.3.5 got a lot of errors \"TypeError: Cannot read property 'change' of undefined\" in code which worked well in 1.3.4."},"comment":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/comments/181050024","html_url":"https://github.com/Urigo/angular-meteor/issues/1105#issuecomment-181050024","issue_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1105","id":181050024,"user":{"login":"ozsay","id":3464930,"avatar_url":"https://avatars.githubusercontent.com/u/3464930?v=3","gravatar_id":"","url":"https://api.github.com/users/ozsay","html_url":"https://github.com/ozsay","followers_url":"https://api.github.com/users/ozsay/followers","following_url":"https://api.github.com/users/ozsay/following{/other_user}","gists_url":"https://api.github.com/users/ozsay/gists{/gist_id}","starred_url":"https://api.github.com/users/ozsay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozsay/subscriptions","organizations_url":"https://api.github.com/users/ozsay/orgs","repos_url":"https://api.github.com/users/ozsay/repos","events_url":"https://api.github.com/users/ozsay/events{/privacy}","received_events_url":"https://api.github.com/users/ozsay/received_events","type":"User","site_admin":false},"created_at":"2016-02-07T16:59:01Z","updated_at":"2016-02-07T16:59:01Z","body":"Hi, I found out what seems to be the issue here. Since `filter` is an `object` you need to specify that we do a deep watch like this:\r\n\r\n```js\r\n\tlink: ($scope) ->\r\n\t\t$scope.helpers\r\n\t\t\tcols: () -> Collection.find($scope.getReactively('filter', true))\r\n```\r\n\r\nHopefully this solve your main issue"}}