{"action":"created","issue":{"url":"https://api.github.com/repos/dart-lang/site-webdev/issues/1594","repository_url":"https://api.github.com/repos/dart-lang/site-webdev","labels_url":"https://api.github.com/repos/dart-lang/site-webdev/issues/1594/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/site-webdev/issues/1594/comments","events_url":"https://api.github.com/repos/dart-lang/site-webdev/issues/1594/events","html_url":"https://github.com/dart-lang/site-webdev/issues/1594","id":323164687,"number":1594,"title":"documentation: template reference variable scope","user":{"login":"sannysanoff","id":952071,"avatar_url":"https://avatars3.githubusercontent.com/u/952071?v=4","gravatar_id":"","url":"https://api.github.com/users/sannysanoff","html_url":"https://github.com/sannysanoff","followers_url":"https://api.github.com/users/sannysanoff/followers","following_url":"https://api.github.com/users/sannysanoff/following{/other_user}","gists_url":"https://api.github.com/users/sannysanoff/gists{/gist_id}","starred_url":"https://api.github.com/users/sannysanoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sannysanoff/subscriptions","organizations_url":"https://api.github.com/users/sannysanoff/orgs","repos_url":"https://api.github.com/users/sannysanoff/repos","events_url":"https://api.github.com/users/sannysanoff/events{/privacy}","received_events_url":"https://api.github.com/users/sannysanoff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-15T10:49:27Z","updated_at":"2018-05-17T13:07:10Z","closed_at":null,"author_association":"NONE","body":"It is explicitly  mentioned in docs that template reference variable scope is global. To my surprise, I declared variable and was unable to reference it in other place. The error was displayed in JS console, saying that setter/getter is missing for variable i was trying to reference. In my case message (combined with docs) was misleading. \r\n\r\nTurned out, I was declaring template reference variable inside  *ngIf scope, and referencing outside it, and as I'm new to angular, this was not obvious to me.  I think it worths including this case in the docs.\r\n"},"comment":{"url":"https://api.github.com/repos/dart-lang/site-webdev/issues/comments/389859680","html_url":"https://github.com/dart-lang/site-webdev/issues/1594#issuecomment-389859680","issue_url":"https://api.github.com/repos/dart-lang/site-webdev/issues/1594","id":389859680,"user":{"login":"chalin","id":4140793,"avatar_url":"https://avatars1.githubusercontent.com/u/4140793?v=4","gravatar_id":"","url":"https://api.github.com/users/chalin","html_url":"https://github.com/chalin","followers_url":"https://api.github.com/users/chalin/followers","following_url":"https://api.github.com/users/chalin/following{/other_user}","gists_url":"https://api.github.com/users/chalin/gists{/gist_id}","starred_url":"https://api.github.com/users/chalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chalin/subscriptions","organizations_url":"https://api.github.com/users/chalin/orgs","repos_url":"https://api.github.com/users/chalin/repos","events_url":"https://api.github.com/users/chalin/events{/privacy}","received_events_url":"https://api.github.com/users/chalin/received_events","type":"User","site_admin":false},"created_at":"2018-05-17T13:07:10Z","updated_at":"2018-05-17T13:07:10Z","author_association":"COLLABORATOR","body":"@matanlurey, @alorenzen: what are the implications of defining a template reference variable inside an `*ngIf` annotated element? Does the `ngIf` essentially scope the variable? It would seem reasonable that it would, but I don't think that there used to be any such scoping in, say, Angular 2. If there is scoping now, which directives introduce variable scope? /cc @kwalrath @kevmoo "}}
{"actor":{"display_login":"chalin"}}