angularjs - Error: $injector:modulerr Module Error in angular1 -
i have implemented ui-router in angular 1 application , configured route state. when try access page, error mentioned in title of post. please find code below. tell me have gone wrong.
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 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 load product data: ' + error.message; }); vm.showimage = false; vm.toggleimage = function () { vm.showimage = !vm.showimage; }; } }());
the 1 thing in config needs changing:
.config(["stateprovider",
to
.config(['$stateprovider',
Comments
Post a Comment