{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/blaze/issues/55","repository_url":"https://api.github.com/repos/meteor/blaze","labels_url":"https://api.github.com/repos/meteor/blaze/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/meteor/blaze/issues/55/comments","events_url":"https://api.github.com/repos/meteor/blaze/issues/55/events","html_url":"https://github.com/meteor/blaze/issues/55","id":173603744,"number":55,"title":"Introspection of Current Scope","user":{"login":"convexset","id":1677933,"avatar_url":"https://avatars.githubusercontent.com/u/1677933?v=3","gravatar_id":"","url":"https://api.github.com/users/convexset","html_url":"https://github.com/convexset","followers_url":"https://api.github.com/users/convexset/followers","following_url":"https://api.github.com/users/convexset/following{/other_user}","gists_url":"https://api.github.com/users/convexset/gists{/gist_id}","starred_url":"https://api.github.com/users/convexset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/convexset/subscriptions","organizations_url":"https://api.github.com/users/convexset/orgs","repos_url":"https://api.github.com/users/convexset/repos","events_url":"https://api.github.com/users/convexset/events{/privacy}","received_events_url":"https://api.github.com/users/convexset/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-27T16:29:35Z","updated_at":"2016-08-30T07:11:17Z","closed_at":null,"body":"There should be functionality for viewing the current scope programatically just as we can for the data context with `Template.currentData()`... For instance:\r\n```\r\n{{#each things}}\r\n   <!-- Template.currentData() equals each of the items in things -->\r\n{{/each}}\r\n```\r\n\r\nBut with \"scope\", there isn't a similar `Template.currentScope()`...\r\n```\r\n{{#each x in things}}\r\n   <!-- x is added to the scope; accessible to helpers by passing but... -->\r\n{{/each}}\r\n```"},"comment":{"url":"https://api.github.com/repos/meteor/blaze/issues/comments/243352659","html_url":"https://github.com/meteor/blaze/issues/55#issuecomment-243352659","issue_url":"https://api.github.com/repos/meteor/blaze/issues/55","id":243352659,"user":{"login":"stubailo","id":448783,"avatar_url":"https://avatars.githubusercontent.com/u/448783?v=3","gravatar_id":"","url":"https://api.github.com/users/stubailo","html_url":"https://github.com/stubailo","followers_url":"https://api.github.com/users/stubailo/followers","following_url":"https://api.github.com/users/stubailo/following{/other_user}","gists_url":"https://api.github.com/users/stubailo/gists{/gist_id}","starred_url":"https://api.github.com/users/stubailo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stubailo/subscriptions","organizations_url":"https://api.github.com/users/stubailo/orgs","repos_url":"https://api.github.com/users/stubailo/repos","events_url":"https://api.github.com/users/stubailo/events{/privacy}","received_events_url":"https://api.github.com/users/stubailo/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T07:11:17Z","updated_at":"2016-08-30T07:11:17Z","body":"```\r\n{{#each wally in people}}\r\n  [S1]\r\n  {{#each p in props}}\r\n    [S2]\r\n    Where's wally?\r\n  {{/each}}\r\n{{/each}}\r\n```\r\n\r\nIn this case, wally is accessible.\r\n\r\nBy the way, in this example:\r\n\r\n```\r\n<template name=\"ParentTemplate\">\r\n  {{#let x=5}}\r\n    {{> ChildTemplate}}\r\n  {{/let}}\r\n</template>\r\n\r\n<template name=\"ChildTemplate\">\r\nCan't see x here!\r\n</template>\r\n```\r\n\r\nThink of a template as a function:\r\n\r\n```\r\nfunction parentTemplate() {\r\n  var x = 5;\r\n  childTemplate();\r\n}\r\n\r\nfunction childTemplate() {\r\n  // of course you don't see x here!\r\n}\r\n```\r\n\r\nI feel like it would be way easier if Blaze and JavaScript variables worked the same way, considering templates to be like functions.\r\n\r\nBy the way, `this` in JavaScript doesn't match how data context in Blaze behaves at all - `this` doesn't get magically passed between function calls."}}
{"actor":{"display_login":"stubailo"}}