我正在构建一个新的angularJS应用程序,基于AngularJS SPA Visual studio模板(http://visualstudiogallery.msdn.microsoft.com/5af151b2-9ed2-4809-bfe8-27566bfe7d83)
这使用ui-router(https://github.com/angular-ui/ui-router)进行路由.
但是,它似乎区分大小写.
知道如何指示angular/ui-router忽略url参数的情况吗?
在应用程序中区分大小写无关紧要,但是如果用户键入一个URL以在特定页面上输入应用程序,我们需要确保它about也是相同的aBouT
干杯
我尝试使用html5Modeui-router 时遇到上述错误.谁能指出我做错了什么?
TypeError: Cannot read property 'replace' of undefined
at bd (angular.js:10555)
at Object.<anonymous> (angular.js:11403)
at l.$get.l.$digest (angular.js:14222)
at l.$get.l.$apply (angular.js:14493)
at angular.js:1449
at Object.e [as invoke] (angular.js:4182)
at d (angular.js:1447)
at sc (angular.js:1467)
at Jd (angular.js:1361)
at HTMLDocument.<anonymous> (angular.js:26086)
Run Code Online (Sandbox Code Playgroud)
该部分angular.js是:
10554 function trimEmptyHash(url) {
10555 return url.replace(/(#.+)|#$/, '$1');
10556 }
Run Code Online (Sandbox Code Playgroud)
路由文件:
(function(){
'use strict';
angular
.module('app')
.config(routes);
routes.$inject = ['$stateProvider', '$locationProvider'];
function routes($stateProvider, $locationProvider) {
// Configure app states
$stateProvider
.state('app', {
abstract: true,
templateUrl: …Run Code Online (Sandbox Code Playgroud)