Getting “could not resolve … from state …” error when using nested routes angularjs

前端 未结 1 1768

I\'m new to angularjs and I want to use nested ui-routes for my application. Some code snippets ...

profile.html

相关标签:
1条回答
  • 2020-12-13 19:37

    In this case, angular is informing us: I simply cannot find the state edit_profile. I created working example here

    The reason is in fact, that we really have to load 2 js files:

    • profile.js
    • client_UI.js

    both of them must be loaded but both of them cannot declare the same module:

    var route = angular.module('route', ["ui.router"])
    

    one of them must be different or just not declare but consume the module:

    // client_UI.js
    var route = angular.module('client_ui', ["ui.router"])
    // profile.js
    var route = angular.module('route', ["ui.router", "client_ui"])
    

    or both could be in same module:

    // client_UI.js
    var route = angular.module('route', ["ui.router"])
    // profile.js
    var route = angular.module('route')
    

    Check that all working here

    0 讨论(0)
提交回复
热议问题