无法解决州'家'的'___'

时间:2017-02-12 18:10:35

标签: angularjs ui-sref

为什么我收到此错误? state.js文件很简单

(function() {
    'use strict';

    angular
        .module('theFoodApp')
        .config(stateConfig);

    stateConfig.$inject = ['$stateProvider'];

    function stateConfig($stateProvider) {

        $stateProvider.state('concludi', {
            parent: 'app',
            url: '/concludi-acquisto',
            views: {
                'content@': {
                    templateUrl: 'app/pages/carrello/concludi-acquisto/concludi-acquisto.html',
                    controller: 'ConcludiAcquistoController',
                    controllerAs: 'vm'
                }
            }
        });
    }
})();

模板页面存在于指定的路径和控制器中。 在其他页面我有一个ui-sref =“concludi”的按钮但是当我按它时我收到此错误

Error: Could not resolve 'concludi' from state 'home'
    at Object.transitionTo (angular-ui-router.js:3180)
    at Object.go (angular-ui-router.js:3108)
    at angular-ui-router.js:4159
    at angular.js:19612
    at completeOutstandingRequest (angular.js:5964)
    at angular.js:6243

1 个答案:

答案 0 :(得分:0)

确保您将states.js 导入index.html