angularjs - how to use a single controller for multiple routes -


how assign couple of controller , view multiple route patterns in angularjs? example have couple of view , controller:

{   templateurl: '/partial/single-item.html',   controller: 'singleitemcontroller' } 

witch want them 2 routes:

/car/:id /bike/:id 

you can have route : /:myroute/:id , test in controller(or in route regex) value of myroute example


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -