{"action":"created","issue":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1087","labels_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1087/labels{/name}","comments_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1087/comments","events_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1087/events","html_url":"https://github.com/Urigo/angular-meteor/issues/1087","id":125987148,"number":1087,"title":"Pass parameter to helper function","user":{"login":"Fauphi","id":1148532,"avatar_url":"https://avatars.githubusercontent.com/u/1148532?v=3","gravatar_id":"","url":"https://api.github.com/users/Fauphi","html_url":"https://github.com/Fauphi","followers_url":"https://api.github.com/users/Fauphi/followers","following_url":"https://api.github.com/users/Fauphi/following{/other_user}","gists_url":"https://api.github.com/users/Fauphi/gists{/gist_id}","starred_url":"https://api.github.com/users/Fauphi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fauphi/subscriptions","organizations_url":"https://api.github.com/users/Fauphi/orgs","repos_url":"https://api.github.com/users/Fauphi/repos","events_url":"https://api.github.com/users/Fauphi/events{/privacy}","received_events_url":"https://api.github.com/users/Fauphi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-01-11T16:47:57Z","updated_at":"2016-01-12T10:25:38Z","closed_at":null,"body":"How can I pass a parameter to a helper function?\r\n\r\nThis was possible with Blaze:\r\n```javascript\r\nTemplate.dummy.helpers({\r\n\tgetImage: function(imageId) {\r\n\t\treturn Images.findOne(imageId);\r\n\t}\r\n});\r\n```\r\n```html\r\n{{ getImage '1234' }}\r\n```\r\nHow can I do something like that with Angular Meteor?\r\n\r\nThis is not working: \r\n```javascript\r\nthis.helpers({\r\n\tgetImage: (imageId) => {\r\n\t\treturn Images.findOne(imageId);\r\n\t}\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/Urigo/angular-meteor/issues/comments/170866558","html_url":"https://github.com/Urigo/angular-meteor/issues/1087#issuecomment-170866558","issue_url":"https://api.github.com/repos/Urigo/angular-meteor/issues/1087","id":170866558,"user":{"login":"MilosStanic","id":3983854,"avatar_url":"https://avatars.githubusercontent.com/u/3983854?v=3","gravatar_id":"","url":"https://api.github.com/users/MilosStanic","html_url":"https://github.com/MilosStanic","followers_url":"https://api.github.com/users/MilosStanic/followers","following_url":"https://api.github.com/users/MilosStanic/following{/other_user}","gists_url":"https://api.github.com/users/MilosStanic/gists{/gist_id}","starred_url":"https://api.github.com/users/MilosStanic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MilosStanic/subscriptions","organizations_url":"https://api.github.com/users/MilosStanic/orgs","repos_url":"https://api.github.com/users/MilosStanic/repos","events_url":"https://api.github.com/users/MilosStanic/events{/privacy}","received_events_url":"https://api.github.com/users/MilosStanic/received_events","type":"User","site_admin":false},"created_at":"2016-01-12T10:25:38Z","updated_at":"2016-01-12T10:25:38Z","body":"Hi @Fauphi , \r\n\r\nI'm really not sure I understand what is happening here. \r\nYou have a list of work items and a list of images. So, you render work items, and for each you retrieve an image from Images collection. That is clear. \r\nSo when you change an image that is related to work item, you want it to be re-rendered in work items list. \r\nI don't know. This is software design issue. Maybe you should consider redesigning relationships and how you keep data. \r\n\r\nFor example: I have a list of users, and each has an avatar image which is stored also in Images collection. But I keep a `currentAvatar` field in my users collection. So when I change avatar in Images, I also update the `currentAvatar` collection with new avatar link, and it gets re-rendered in list of users. \r\n\r\nSimilarly, you should keep image url for each work item. When you upload/change image for each work item, you update the image url in work items collection. Then it will re-render list with new image. Actually, it will only retrieve a new image when ng-src changes for particular item in work list, because that's how ng-src works. \r\n\r\nI hope I helped.\r\n\r\nBut, anyway, your scenario is also interesting. If you find a solution to your problem with current design, please post here. "}}