{"action":"created","issue":{"url":"https://api.github.com/repos/bitovi/canjs/issues/1808","labels_url":"https://api.github.com/repos/bitovi/canjs/issues/1808/labels{/name}","comments_url":"https://api.github.com/repos/bitovi/canjs/issues/1808/comments","events_url":"https://api.github.com/repos/bitovi/canjs/issues/1808/events","html_url":"https://github.com/bitovi/canjs/issues/1808","id":97512809,"number":1808,"title":"Helpers are not getting called for can.Component if template is loaded through steal","user":{"login":"opolyo01","id":558296,"avatar_url":"https://avatars.githubusercontent.com/u/558296?v=3","gravatar_id":"","url":"https://api.github.com/users/opolyo01","html_url":"https://github.com/opolyo01","followers_url":"https://api.github.com/users/opolyo01/followers","following_url":"https://api.github.com/users/opolyo01/following{/other_user}","gists_url":"https://api.github.com/users/opolyo01/gists{/gist_id}","starred_url":"https://api.github.com/users/opolyo01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opolyo01/subscriptions","organizations_url":"https://api.github.com/users/opolyo01/orgs","repos_url":"https://api.github.com/users/opolyo01/repos","events_url":"https://api.github.com/users/opolyo01/events{/privacy}","received_events_url":"https://api.github.com/users/opolyo01/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bitovi/canjs/labels/Bug","name":"Bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-27T17:22:30Z","updated_at":"2015-07-28T04:53:23Z","closed_at":null,"body":"If you try loading template with steal from external stache file, the helpers will not be getting called\r\n````\r\nsteal(\r\n\"./date-picker.stache!\",\r\n//global\r\n\"can\",\r\nfunction (template, can) {\r\n    can.Component.extend({\r\n        tag: \"date-picker\",\r\n        template: template,\r\n        scope: {},\r\n        helpers:{\r\n            modifiedName: function(name){\r\n              name = typeof name === \"function\" ? name() : name;\r\n              return \"Custom \" + name;\r\n            }\r\n        }\r\n    });\r\n}\r\n);\r\n````\r\n\r\nHowever, if I declare template inline helpers is getting called\r\n````\r\nsteal(\r\n\"./date-picker.stache!\",\r\n//global\r\n\"can\",\r\nfunction (template, can) {\r\n    can.Component.extend({\r\n        tag: \"date-picker\",\r\n        template: \"{{modifiedName 'randomName'}}\",\r\n        scope: {},\r\n        helpers:{\r\n            modifiedName: function(name){\r\n              name = typeof name === \"function\" ? name() : name;\r\n              return \"Custom \" + name;\r\n            }\r\n        }\r\n    });\r\n}\r\n);\r\n````"},"comment":{"url":"https://api.github.com/repos/bitovi/canjs/issues/comments/125446896","html_url":"https://github.com/bitovi/canjs/issues/1808#issuecomment-125446896","issue_url":"https://api.github.com/repos/bitovi/canjs/issues/1808","id":125446896,"user":{"login":"justinbmeyer","id":78602,"avatar_url":"https://avatars.githubusercontent.com/u/78602?v=3","gravatar_id":"","url":"https://api.github.com/users/justinbmeyer","html_url":"https://github.com/justinbmeyer","followers_url":"https://api.github.com/users/justinbmeyer/followers","following_url":"https://api.github.com/users/justinbmeyer/following{/other_user}","gists_url":"https://api.github.com/users/justinbmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/justinbmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinbmeyer/subscriptions","organizations_url":"https://api.github.com/users/justinbmeyer/orgs","repos_url":"https://api.github.com/users/justinbmeyer/repos","events_url":"https://api.github.com/users/justinbmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/justinbmeyer/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T04:53:23Z","updated_at":"2015-07-28T04:53:23Z","body":"The actual test in case someone needs it:\r\n\r\n```\r\n\ttest('template helpers passed to template (#1808)', function(){\r\n\t\t\r\n\t\tcan.Component.extend({\r\n\t        tag: \"call-helper\",\r\n\t        template: can.stache(\"{{modifiedName 'randomName'}}\"),\r\n\t        scope: {},\r\n\t        helpers:{\r\n\t            modifiedName: function(name){\r\n\t              name = typeof name === \"function\" ? name() : name;\r\n\t              return \"Custom \" + name;\r\n\t            }\r\n\t        }\r\n\t    });\r\n\t    \r\n\t    var frag = can.stache('<call-helper></call-helper>')();\r\n\t    equal(frag.firstChild.firstChild.nodeValue, \"Custom randomName\");\r\n\t    \r\n\t});\r\n```"}}