{"action":"created","issue":{"url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/432","repository_url":"https://api.github.com/repos/daniel-nagy/md-data-table","labels_url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/432/labels{/name}","comments_url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/432/comments","events_url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/432/events","html_url":"https://github.com/daniel-nagy/md-data-table/issues/432","id":161796238,"number":432,"title":"limitOptions doesn't work with object values","user":{"login":"mirik123","id":9895557,"avatar_url":"https://avatars.githubusercontent.com/u/9895557?v=3","gravatar_id":"","url":"https://api.github.com/users/mirik123","html_url":"https://github.com/mirik123","followers_url":"https://api.github.com/users/mirik123/followers","following_url":"https://api.github.com/users/mirik123/following{/other_user}","gists_url":"https://api.github.com/users/mirik123/gists{/gist_id}","starred_url":"https://api.github.com/users/mirik123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirik123/subscriptions","organizations_url":"https://api.github.com/users/mirik123/orgs","repos_url":"https://api.github.com/users/mirik123/repos","events_url":"https://api.github.com/users/mirik123/events{/privacy}","received_events_url":"https://api.github.com/users/mirik123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-22T21:56:17Z","updated_at":"2016-06-22T22:06:59Z","closed_at":null,"body":"The limitOptions example from Readme.MD file switches `this` context to global window object\r\nThis code is problematic:\r\n````\r\n$scope.tabledata = {\r\ndata: [],\r\ncount: 0,\r\nlimit: 25.\r\npage: 1,\r\nlimitoptions: [10, 25, 50, {\r\n   label: 'All',\r\n   value: function () {\r\n      return this.count; //this === windows\r\n   }\r\n  }]\r\n}\r\n````\r\n\r\nTo make this code work I need to do some trick:\r\n````\r\nlimitoptions: [10, 25, 50, {\r\n   label: 'All',\r\n   value: function () {\r\n      return arguments[0].$parent.tabledata.count;\r\n   }\r\n}]\r\n````\r\n\r\nI think it's a bug and it happens because of the: `$scope.$eval(expression);`\r\nMay be it's worth to use `$scope.$apply` instead of it?\r\n"},"comment":{"url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/comments/227892120","html_url":"https://github.com/daniel-nagy/md-data-table/issues/432#issuecomment-227892120","issue_url":"https://api.github.com/repos/daniel-nagy/md-data-table/issues/432","id":227892120,"user":{"login":"daniel-nagy","id":1622446,"avatar_url":"https://avatars.githubusercontent.com/u/1622446?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-nagy","html_url":"https://github.com/daniel-nagy","followers_url":"https://api.github.com/users/daniel-nagy/followers","following_url":"https://api.github.com/users/daniel-nagy/following{/other_user}","gists_url":"https://api.github.com/users/daniel-nagy/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-nagy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-nagy/subscriptions","organizations_url":"https://api.github.com/users/daniel-nagy/orgs","repos_url":"https://api.github.com/users/daniel-nagy/repos","events_url":"https://api.github.com/users/daniel-nagy/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-nagy/received_events","type":"User","site_admin":false},"created_at":"2016-06-22T22:06:59Z","updated_at":"2016-06-22T22:06:59Z","body":"Take a look at [`function.prototype.bind`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)."}}
{"actor":{"display_login":"daniel-nagy"}}