routes - Angular dart equivalent of anuglar js Otherwise for routing -


i have been pretty comfortable setting route in angular.dart using routeinitializerfn

but have not been able setup '404' route. when user visits unmatched route, should redirected 404.html page.

  myrouter(router router, viewfactory view) {     view.configure({       'home' : ngroute(               defaultroute : true,         view : './home.html' // visiting www.mysite.com load view       ),       'user' : ngroute(         path : '/user',         view : './user.html'       ),       'every-other-route' : ngroute(         path : '*', // apparently wildcard route matching doesn't work in angular         view : '404.html'       ) 

any idea every other route load 404.html page?

the route has defaultroute set true (if any) 1 matched when no other patterns match.

for situation, you'd want move defaultroute property 'home' route , 'every-other-route' route , remove wildcard path 'every-other-route' , give home route path.

that should leave like:

myrouter(router router, viewfactory view) {   view.configure({     'home' : ngroute(        path: '/',        view : './home.html' // visiting www.mysite.com load view     ),     'user' : ngroute(       path : '/user',       view : './user.html'     ),     'every-other-route' : ngroute(       defaultroute: true       view : '404.html'     )   }); } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -