user300057 user300057 - 1 year ago 77
AngularJS Question

app route - not redirecting to html page

This is a sample from MEAN stack website,
I require the browser to point to a html file called ' findCable.html '
instead it keeps routing it to 'singleCable.html'
The code snippet is from angular routing file, I've also checked the back-end route(s) any ideas what's going wrong ?

Please see the attached images too _ TIA

.when('/cable/search', {
templateUrl: 'app/views/pages/cables/findCable.html',
controller: 'cableController',
controllerAs: 'cable'

Screenshot of website code

Answer Source

This is simple routing mistake. Just keep your cable/search route above the cable/:cable_id route which is overriding your search keyword as cable_id

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download