{"action":"created","issue":{"url":"https://api.github.com/repos/SelectTransform/st.js/issues/24","repository_url":"https://api.github.com/repos/SelectTransform/st.js","labels_url":"https://api.github.com/repos/SelectTransform/st.js/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/SelectTransform/st.js/issues/24/comments","events_url":"https://api.github.com/repos/SelectTransform/st.js/issues/24/events","html_url":"https://github.com/SelectTransform/st.js/issues/24","id":343054331,"node_id":"MDU6SXNzdWUzNDMwNTQzMzE=","number":24,"title":".inject() in template with {{each}} is ignored","user":{"login":"cyppher","id":2248108,"node_id":"MDQ6VXNlcjIyNDgxMDg=","avatar_url":"https://avatars3.githubusercontent.com/u/2248108?v=4","gravatar_id":"","url":"https://api.github.com/users/cyppher","html_url":"https://github.com/cyppher","followers_url":"https://api.github.com/users/cyppher/followers","following_url":"https://api.github.com/users/cyppher/following{/other_user}","gists_url":"https://api.github.com/users/cyppher/gists{/gist_id}","starred_url":"https://api.github.com/users/cyppher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyppher/subscriptions","organizations_url":"https://api.github.com/users/cyppher/orgs","repos_url":"https://api.github.com/users/cyppher/repos","events_url":"https://api.github.com/users/cyppher/events{/privacy}","received_events_url":"https://api.github.com/users/cyppher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-20T10:22:14Z","updated_at":"2018-09-12T07:35:08Z","closed_at":null,"author_association":"NONE","body":"### Issue \r\nWhen calling `transformWith` with a template that loops over `items` (with `{{#each items}}`) the **injected** function is ignored and outputted as String.\r\n\r\nThe issue occurs with this (partial) code:\r\n**data:**\r\n```\r\n{ \"items\": [\r\n{ ..., \"status\": \"confirmed\" },\r\n...\r\n] }\r\n```\r\n\r\n**template:** \r\n`\"{{#each items}}\": { \"status\": \"{{_.upperCase(this.status)}}\", }` \r\n\r\n**ST code**\r\n```\r\n...\r\nconst _ = require('lodash');\r\n\r\nreturn ST.select(embeddedArray)\r\n    .inject({_:_})\r\n    .transformWith(template)\r\n    .root();\r\n...\r\n```\r\n\r\n**result**\r\n`\"status\": \"_.upperCase(this.status)\"`\r\n\r\n### Expected result\r\n `\"status\": \"CONFIRMED\"`\r\n\r\nWhen I look into test code, I only see a simple test case, this generic case is not covered. \r\nCan you please take a look into this issue / point me in the right direction for a fix / pull request?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/SelectTransform/st.js/issues/comments/420544084","html_url":"https://github.com/SelectTransform/st.js/issues/24#issuecomment-420544084","issue_url":"https://api.github.com/repos/SelectTransform/st.js/issues/24","id":420544084,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDU0NDA4NA==","user":{"login":"cyppher","id":2248108,"node_id":"MDQ6VXNlcjIyNDgxMDg=","avatar_url":"https://avatars3.githubusercontent.com/u/2248108?v=4","gravatar_id":"","url":"https://api.github.com/users/cyppher","html_url":"https://github.com/cyppher","followers_url":"https://api.github.com/users/cyppher/followers","following_url":"https://api.github.com/users/cyppher/following{/other_user}","gists_url":"https://api.github.com/users/cyppher/gists{/gist_id}","starred_url":"https://api.github.com/users/cyppher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyppher/subscriptions","organizations_url":"https://api.github.com/users/cyppher/orgs","repos_url":"https://api.github.com/users/cyppher/repos","events_url":"https://api.github.com/users/cyppher/events{/privacy}","received_events_url":"https://api.github.com/users/cyppher/received_events","type":"User","site_admin":false},"created_at":"2018-09-12T07:35:08Z","updated_at":"2018-09-12T07:35:08Z","author_association":"NONE","body":"@smtrd3 not that I'm aware of. "}}
{"actor":{"display_login":"cyppher"}}