0

I'm using angular new router and configured it as following:

this.$router.config([
                {path: '/', component: 'home', as:'home'},
                {path: '/home', component: 'home'},
                {path: '/home/:type/:id', component: 'home'}
            ]);

How can I define a default route when the URL isn't mapped in the list?
I'm searching for something similar to "otherwise" option for a default route.

e.g. when user send /home/group I want it to be mapped to default component, currently I'm getting the following error:

Cannot read property 'canonicalUrl' of undefined

Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
  • You do know that that repo is out of date and not maintained? – vascowhite Feb 28 '16 at 09:19
  • @vascowhite I know but the new router probably will be published in the next angular version and I'm preparing for it like many others in the community – Dor Cohen Feb 28 '16 at 09:24

0 Answers0