无法从状态“ ”解析。我放错了什么配置?

cannot resolve from state ' ' . What configuration did i put wrong?

我正在尝试使用 ui-sref,但它说的是 cannot resolve from ''。我在路由配置中做错了什么。从我的角度来看,一切似乎都配置正确。但是我收到了这个错误。

查看

 <li><a ui-sref="container.demurrage.index">Container Management</a></li>

Js

angular.module("app.container",
    [
        "ui.router",
        "ui.select",
        "ui.bootstrap",
    ])
    .config([
        "$stateProvider", function ($stateProvider) {
            $stateProvider.state("container",
                {
                    url: "/container",
                    template: "<div ui-view></div>",
                    abstract: true
                });
            $stateProvider.state("container.demurrage.index",
                {
                    url: "/demurrage",
                    templateUrl: "/container/demurrageindex",
                    controller: "demurrageIndexController",
                    resolve: {

                    }
                });
    

        }
    ])

对于有同样问题的人,我 post 解决方案是命名问题。

如果 parent 是 container,则 children 应该是 container.{some name} 而不是 container.{name}.{name}

angular.module("app.container",
    [
        "ui.router",
        "ui.select",
        "ui.bootstrap",
    ])
    .config([
        "$stateProvider", function ($stateProvider) {
            $stateProvider.state("container",
                {
                    url: "/container",
                    template: "<div ui-view></div>",
                    abstract: true
                });
            $stateProvider.state("container.demurrageindex",
                {
                    url: "/demurrage",
                    templateUrl: "/container/demurrageindex",
                    controller: "demurrageIndexController",
                    resolve: {

                    }
                });
    

        }
    ])