{"action":"created","issue":{"url":"https://api.github.com/repos/riot/riot/issues/1415","labels_url":"https://api.github.com/repos/riot/riot/issues/1415/labels{/name}","comments_url":"https://api.github.com/repos/riot/riot/issues/1415/comments","events_url":"https://api.github.com/repos/riot/riot/issues/1415/events","html_url":"https://github.com/riot/riot/issues/1415","id":120995293,"number":1415,"title":"Naming parent tags / tag aliases","user":{"login":"nippur72","id":2598443,"avatar_url":"https://avatars.githubusercontent.com/u/2598443?v=3","gravatar_id":"","url":"https://api.github.com/users/nippur72","html_url":"https://github.com/nippur72","followers_url":"https://api.github.com/users/nippur72/followers","following_url":"https://api.github.com/users/nippur72/following{/other_user}","gists_url":"https://api.github.com/users/nippur72/gists{/gist_id}","starred_url":"https://api.github.com/users/nippur72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nippur72/subscriptions","organizations_url":"https://api.github.com/users/nippur72/orgs","repos_url":"https://api.github.com/users/nippur72/repos","events_url":"https://api.github.com/users/nippur72/events{/privacy}","received_events_url":"https://api.github.com/users/nippur72/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/riot/riot/labels/discussion","name":"discussion","color":"ff44aa"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-12-08T12:19:20Z","updated_at":"2015-12-09T21:30:15Z","closed_at":null,"body":"From [this forum post](http://riotjs.com/forum/#!/using:scopes-of-nested-custom-tag) (but I also remember we discussed about it here at least a couple of times).\r\n\r\nIt's the problem of the annoying `parent` references when you use child tags. \r\n\r\nWhat I propose is that we add the possibility to name parent tags, so to make them available to all children. Similar to the existing named tags (`id` and `name`) but applied backwards to parents.\r\n\r\nIn [this proof of concept](http://plnkr.co/edit/mfZs4kOuWGrZK1LTn2DY?p=preview) the attribute `alias` is used to provide a name for the tag:\r\n```HTML\r\n<outer alias=\"outer\">  \r\n  <inner>\r\n    <div onclick={outer.hitme}>click me for outer!</div>\r\n     <inner>\r\n       <div onclick={outer.hitme}>click me for outer!</div>\r\n     </inner>\r\n  </inner>\r\n</outer>\r\n```\r\nIn brief, the alias is created as a property on the child and propagated to all sub-children. The above POC uses a mixin to do that, but it's slow and inefficient. Best would be if Riot implemented it natively.\r\n\r\nI don't know much of other frameworks, but at least Angular 1.x has a similar feature called \"controller as\" which is widely used. \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/riot/riot/issues/comments/163397386","html_url":"https://github.com/riot/riot/issues/1415#issuecomment-163397386","issue_url":"https://api.github.com/repos/riot/riot/issues/1415","id":163397386,"user":{"login":"aMarCruz","id":6636980,"avatar_url":"https://avatars.githubusercontent.com/u/6636980?v=3","gravatar_id":"","url":"https://api.github.com/users/aMarCruz","html_url":"https://github.com/aMarCruz","followers_url":"https://api.github.com/users/aMarCruz/followers","following_url":"https://api.github.com/users/aMarCruz/following{/other_user}","gists_url":"https://api.github.com/users/aMarCruz/gists{/gist_id}","starred_url":"https://api.github.com/users/aMarCruz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aMarCruz/subscriptions","organizations_url":"https://api.github.com/users/aMarCruz/orgs","repos_url":"https://api.github.com/users/aMarCruz/repos","events_url":"https://api.github.com/users/aMarCruz/events{/privacy}","received_events_url":"https://api.github.com/users/aMarCruz/received_events","type":"User","site_admin":false},"created_at":"2015-12-09T21:30:15Z","updated_at":"2015-12-09T21:30:15Z","body":"It is [working in jsbin](http://jsbin.com/ponituzabu/1/edit?html,js,output)"}}