javascript - AngularJS Routing Case Sensitivity -
i haven't been able find straightforward answer this, leads me believe it's really simple. either way, here go.
all of calls in $routeprovider work great, case sensitive. here's code sample:
config(function ($routeprovider) { $routeprovider. when('/', { controller: 'tmpctrl', templateurl: '/app/home.html' }). when('/foo', { controller: 'tmpctrl', templateurl: '/app/foo.html' }). otherwise({ redirectto: '/' }); });
what need add '/foo', '/foo', '/foo', etc, redirect same path?
there option can pass $routeprovider toggle case sensitivity:
config(function ($routeprovider) { $routeprovider. when('/', { controller: 'tmpctrl', templateurl: '/app/home.html' }). when('/foo', { controller: 'tmpctrl', templateurl: '/app/foo.html', caseinsensitivematch: true }). otherwise({ redirectto: '/' }); });
Comments
Post a Comment