{"action":"created","issue":{"url":"https://api.github.com/repos/Polymore/more-routing/issues/17","labels_url":"https://api.github.com/repos/Polymore/more-routing/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/Polymore/more-routing/issues/17/comments","events_url":"https://api.github.com/repos/Polymore/more-routing/issues/17/events","html_url":"https://github.com/Polymore/more-routing/issues/17","id":60577050,"number":17,"title":"Bug: more-route-selector don't work this dynamic core-item made with template repeat","user":{"login":"jmorille","id":538320,"avatar_url":"https://avatars.githubusercontent.com/u/538320?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorille","html_url":"https://github.com/jmorille","followers_url":"https://api.github.com/users/jmorille/followers","following_url":"https://api.github.com/users/jmorille/following{/other_user}","gists_url":"https://api.github.com/users/jmorille/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorille/subscriptions","organizations_url":"https://api.github.com/users/jmorille/orgs","repos_url":"https://api.github.com/users/jmorille/repos","events_url":"https://api.github.com/users/jmorille/events{/privacy}","received_events_url":"https://api.github.com/users/jmorille/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-10T22:03:53Z","updated_at":"2015-03-16T18:50:33Z","closed_at":null,"body":"on the   \"more-routing\": \"Polymore/more-routing#~0.5.0\"\r\n\r\nReplace this working static menu\r\n```javascript\r\n <more-route-selector>\r\n      <core-menu>\r\n        <core-item  icon=\"home\"  label=\"Home\" route=\"home\">\r\n          <a href=\"{{urlFor('home')}}\"></a>\r\n        </core-item>\r\n        <core-item icon=\"supervisor-account\"  label=\"User\" route=\"user\">\r\n          <a href=\"{{urlFor('user')}}\"></a>\r\n        </core-item>\r\n        <core-item icon=\"perm-media\" label=\"Portfolio\" route=\"portfolio\">\r\n          <a href=\"{{urlFor('portfolio')}}\"></a>\r\n        </core-item>\r\n        <core-item icon=\"perm-contact-cal\" label=\"Contact\" route=\"contact\">\r\n          <a href=\"{{urlFor('contact')}}\"></a>\r\n        </core-item>\r\n      </core-menu>\r\n    </more-route-selector>\r\n```\r\n\r\nwith the equivalent dynamic one\r\n```javascript\r\n    <more-route-selector>\r\n      <core-menu>\r\n        <template repeat=\"{{menu in menus}}\">\r\n          <core-item icon=\"{{menu.icon}}\" label=\"{{menu.label}}\" route=\"{{menu.route}}\">\r\n            <a href=\"{{urlFor(menu.route)}}\"></a>\r\n          </core-item>\r\n        </template>\r\n      </core-menu>\r\n    </more-route-selector>\r\n</template>\r\n<script>\r\n..\r\n menus: undefined,\r\n      created: function () {\r\n        this.menus = [\r\n          {icon: 'home', label: 'Home', route: 'home'},\r\n          {icon: 'supervisor-account', label: 'User', route: 'user'},\r\n          {icon: 'perm-media', label: 'Portfolio', route: 'portfolio'},\r\n          {icon: 'perm-contact-cal', label: 'Contact', route: 'contact'}\r\n        ];\r\n      }\r\n```\r\nand no selection was possible on the menu item with the template one.\r\n\r\nand a message is writed in javascript console\r\n``` console\r\nChild of  <more-route-selector> is missing route attribute \"route\":   <template repeat=\"{{menu in menus}}\"></template>            more-route-selector.html:140\r\n```"},"comment":{"url":"https://api.github.com/repos/Polymore/more-routing/issues/comments/81866995","html_url":"https://github.com/Polymore/more-routing/issues/17#issuecomment-81866995","issue_url":"https://api.github.com/repos/Polymore/more-routing/issues/17","id":81866995,"user":{"login":"nevir","id":41373,"avatar_url":"https://avatars.githubusercontent.com/u/41373?v=3","gravatar_id":"","url":"https://api.github.com/users/nevir","html_url":"https://github.com/nevir","followers_url":"https://api.github.com/users/nevir/followers","following_url":"https://api.github.com/users/nevir/following{/other_user}","gists_url":"https://api.github.com/users/nevir/gists{/gist_id}","starred_url":"https://api.github.com/users/nevir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevir/subscriptions","organizations_url":"https://api.github.com/users/nevir/orgs","repos_url":"https://api.github.com/users/nevir/repos","events_url":"https://api.github.com/users/nevir/events{/privacy}","received_events_url":"https://api.github.com/users/nevir/received_events","type":"User","site_admin":false},"created_at":"2015-03-16T18:50:33Z","updated_at":"2015-03-16T18:50:33Z","body":"Aha! So the null route is coming from the template element (template repeats stay in the final DOM, and all their generated elements follow them) - that's also where you're getting the warning. Might be worth having `<more-route-selector>` ignore `<template>` elements.\r\n\r\nOn the two routes being active, that's correct and has been a difficult behavior of more routing for me to document :( Here's a quick try:\r\n\r\nIf your URL is `/foo/bar`, the route `/foo/bar` is active, but the route `/foo` would also be active, as is the route `/`. (They're a prefix match). This allows for better composition where elements/contexts can create sub routes.\r\n\r\n`<more-route-selector>` will choose the _most specific_ route (e.g. route w/ the most path parts). So if `/` and `/foo/` are active, it'll choose `/foo` over `/`. The bulk of that logic is in https://github.com/Polymore/more-routing/blob/master/more-route-selection.html#L141-171 when it sorts the routes by specificity"}}