angular.js使用ui-router注入报错,这里是版本问题导致的

 

报错如下:

common.ts:604Uncaught SyntaxError: Unexpected token ) stateEvents.ts:211Uncaught SyntaxError: Unexpected token ) jquery.js:3827 Uncaught Error: [$injector:modulerr] Failed to instantiate module salesApp due to: Error: [$injector:modulerr] Failed to instantiate module ui.router due to: Error: [$injector:nomod] Module 'ui.router' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. http://errors.angularjs.org/1.3.20/$injector/nomod?p0=ui.router at http://localhost:9006/bower_components/angular/angular.js:63:12 at http://localhost:9006/bower_components/angular/angular.js:1778:17 at ensure (http://localhost:9006/bower_components/angular/angular.js:1702:38) at module (http://localhost:9006/bower_components/angular/angular.js:1776:14) at http://localhost:9006/bower_components/angular/angular.js:4131:22 at forEach (http://localhost:9006/bower_components/angular/angular.js:326:20) at loadModules (http://localhost:9006/bower_components/angular/angular.js:4115:5) at http://localhost:9006/bower_components/angular/angular.js:4132:40 at forEach (http://localhost:9006/bower_components/angular/angular.js:326:20) at loadModules (http://localhost:9006/bower_components/angular/angular.js:4115:5) http://errors.angularjs.org/1.3.20/$injector/modulerr?p0=ui.router&p1=Error…2F%2Flocalhost%3A9006%2Fbower_components%2Fangular%2Fangular.js%3A4115%3A5)
View Code

 

我这个错误是由于版本问题导致的。版本用的比较老,

加上代码:

"angular-ui-router": "1.0.5"
指定了较低的版本之后可以了。

 

参考博文:

https://code.angularjs.org/1.3.20/docs/error/$injector/modulerr

 

https://www.jianshu.com/p/85220470cbfe

 

转载于:https://www.cnblogs.com/hui-run/p/9050637.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值