AngularJS caseInsensitiveMatch不工作 [英] AngularJS caseInsensitiveMatch not working

查看:420
本文介绍了AngularJS caseInsensitiveMatch不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

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

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

什么我做错了吗?

下面是在控制台输出

 未捕获类型错误:无法读取属性'1'空angular.js的:5637
matchUrl 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:148
createInjector angular.js:2775
resumeBootstrapInternal angular.js:1001
引导angular.js:1017
angularInit angular.js:977
(匿名函数)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不是角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.

这篇关于AngularJS caseInsensitiveMatch不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆