AngularJS UI-Router:“toState。$$状态不是函数”

时间:2015-08-23 19:18:29

标签: angularjs angular-ui-router angular-ui

  • Angular 1.4.4
  • UI-Router 0.2.15
  • UI-Router Extras 0.0.14
  • jQuery 2.1.4

堆栈追踪:

TypeError: toState.$$state is not a function
    at ct-ui-router-extras.dsr.js:141
    at Object.forEach (angular.js:350)
    at ct-ui-router-extras.dsr.js:137
    at Scope.$get.Scope.$broadcast (angular.js:16238)
    at $state.transitionTo.$state.transition.resolved.then.$state.transition (angular-ui-router.js:3311)
    at processQueue (angular.js:14634)
    at angular.js:14650
    at Scope.$get.Scope.$eval (angular.js:15916)
    at Scope.$get.Scope.$digest (angular.js:15727)
    at Scope.$get.Scope.$apply (angular.js:16024)
        (anonymous function) @ angular.js:12416
        $get @ angular.js:9203
        $get.Scope.$broadcast @ angular.js:16240
        $state.transitionTo.$state.transition.resolved.then.$state.transition @ angular-ui-router.js:3311
        processQueue @ angular.js:14634
        (anonymous function) @ angular.js:14650
        $get.Scope.$eval @ angular.js:15916
        $get.Scope.$digest @ angular.js:15727
        $get.Scope.$apply @ angular.js:16024
        bootstrapApply @ angular.js:1658
        invoke @ angular.js:4473
        doBootstrap @ angular.js:1656
        bootstrap @ angular.js:1676
        angularInit @ angular.js:1570
        (anonymous function) @ angular.js:28599
        jQuery.Callbacks.fire @ jquery.js:3099
        jQuery.Callbacks.self.fireWith @ jquery.js:3211
        jQuery.extend.ready @ jquery.js:3417
        completed @ jquery.js:3433

从初步研究来看,我认为这是来自某种版本的冲突,但是将我的所有bower.json依赖关系更新到最新版本并没有解决问题(甚至可能是问题的原因,但是我无法确定哪些软件包交互得很糟糕。)

{
  "devDependencies": {
    "angular-mocks": "latest"
  },
  "dependencies": {
    "angular": "latest",
    "bootstrap": "3.x",
    "angular-bootstrap": "latest",
    "angular-ui-router": "latest",
    "ui-router-extras": "latest",
    "angular-moment": "latest",
    "angular-daterangepicker": "latest",
    "ng-jcrop": "latest",
    "ngGAPI": "https://github.com/christiansmith/ngGAPI.git",
    "angular-permission": "latest",
    "angular-ui-calendar": "latest"
  },
  "resolutions": {
    "angular": ">=1.0.8",
    "isotope": "~2.1.1",
    "fullcalendar": "~2.3.2",
    "outlayer": "^1.2.0"
  }
}

1 个答案:

答案 0 :(得分:0)

我找到了对你有用的东西

https://github.com/angular-ui/ui-router/issues/1544

我希望它可以帮到你,看到最后的评论