AngularJS caseInsensitiveMatch不工作工作、AngularJS、caseInsensitiveMatch

由网友(考不上高中去抗日)分享简介:我提到 AngularJS +基本href区分大小写?这个线程。按照我应该还是不过我有问题要使用1.1​​.5。角仍返回相同的error.Here是我在做什么。 $ routeProvider.otherwise({redirectTo:'/',caseInsensitiveMatch:真}); 我的基本href...

我提到 AngularJS +基本href区分大小写?这个线程。按照我应该还是不过我有问题要使用1.1​​.5。

角仍返回相同的error.Here是我在做什么。

  $ routeProvider.otherwise({redirectTo:'/',caseInsensitiveMatch:真}); 

我的基本href /应用程序的名字/ 。现在任何人都可以像输入网址 AppName的的appName 或任意组合。

现在路由的作品,只有当URL包含什么是基本href给出。

什么我做错了吗?

下面是在控制台输出

 未捕获类型错误:无法读取属性'1'空angular.js的:5637matchUrl angular.js:5637$$解析angular.js:5704$得到angular.js:6120调用angular.js:2931(匿名函数)angular.js:2771的getService angular.js:2891调用angular.js:2909(匿名函数)angular.js:2771的getService angular.js:2891调用angular.js:2909(匿名函数)angular.js:2775的forEach angular.js:148createInjector angular.js:2775resumeBootstrapInternal angular.js:1001引导angular.js:1017angularInit angular.js:977(匿名函数)angular.js:16872jQuery.Callbacks.fire的jQuery-1.8.2.js:974jQuery.Callbacks.self.fireWith的jQuery-1.8.2.js:1082jQuery.extend.ready的jQuery-1.8.2.js:406DOMContentLoaded jQuery的-1.8.2.js:83 
在下一个Web应用程序中使用AngularJS的7大理由

解决方案

caseInsensitiveMatch不是角1.1.5的文件中。看来最好的升级,看看是否能解决这个问题。

I referred to AngularJS + Base Href Case Sensitive? this thread. As per that I should be using 1.1.5 however still I am having the problem.

Angular is still returning the same error.Here is what i am doing.

$routeProvider.otherwise({ redirectTo: '/' , caseInsensitiveMatch : true });   

My base Href is /appname/. Now anyone can enter URL like AppName or appName or any combination.

Right now routing works only when URL contains what is given in base href.

Anything I am doing wrong ?

Here is output in console

Uncaught TypeError: Cannot read property '1' of null angular.js:5637
matchUrl angular.js:5637
$$parse angular.js:5704
$get angular.js:6120
invoke angular.js:2931
(anonymous function) angular.js:2771
getService angular.js:2891
invoke angular.js:2909
(anonymous function) angular.js:2771
getService angular.js:2891
invoke angular.js:2909
(anonymous function) angular.js:2775
forEach angular.js:148
createInjector angular.js:2775
resumeBootstrapInternal angular.js:1001
bootstrap angular.js:1017
angularInit angular.js:977
(anonymous function) angular.js:16872
jQuery.Callbacks.fire jquery-1.8.2.js:974
jQuery.Callbacks.self.fireWith jquery-1.8.2.js:1082
jQuery.extend.ready jquery-1.8.2.js:406
DOMContentLoaded jquery-1.8.2.js:83

解决方案

caseInsensitiveMatch is not in the documentation for Angular 1.1.5. It seems best to upgrade and see if that solves the issue.

阅读全文

相关推荐

最新文章