错误:$ injector:modulerr angular1中的模块错误

时间:2017-02-06 07:31:12

标签: angularjs angular-ui-router

我在angular 1应用程序中实现了ui-router,并配置了路由状态。当我尝试访问该页面时,我收到了本文标题中提到的错误。请在下面找到我的代码。有人能告诉我哪里出错了。

app.js

    (function () {
    "use strict";
    var app = angular.module("productManagement", ["common.services","ui.router"]);

}());

config.js

(function () {

    "use strict";
    var app = angular.module("productManagement");


    app.config(["stateProvider",
            function ($stateProvider) { 
                $stateProvider
                .state("productList", {
                    url: "/product",
                    templateUrl: "app/product/productListView.html",
                    controller: "ProductListController as vm"
                });

    }]);

}

());

ProductListController

(function () {

    "use strict";

    angular
        .module("productManagement")
        .controller("ProductListController", ["productResource", ProductListController]);

    function ProductListController (productResource)
    {
        var vm = this;

        productResource.getProducts()
         .then(function (response) {

             vm.products = response.data;
         }, function (error) {
             vm.status = 'Unable to load product data: ' + error.message;
         });



        vm.showImage = false;

        vm.toggleImage = function () {
            vm.showImage = !vm.showImage;
        };

    }

}());

1 个答案:

答案 0 :(得分:1)

他的配置中需要改变的一件事:

<input>

.config(["stateProvider",