我想一起使用 ui-router 和 angular-materialize,但是当我想添加 angular materialize 模块时,它在控制台中显示了这个错误:
错误:[$injector:modulerr] ...
脚本.js
var routerApp = angular.module("routerApp", ["ui.router"], ['ui.materialize']);
routerApp.controller('mainCtrl', ["$scope", function ($scope) {
$scope.select = {
value: "Option1",
choices: ["Option1", "I'm an option", "This is materialize", "No, this is Patrick."]
};
routerApp.config(
["$stateProvider", "$urlRouterProvider",
function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise("/template1");
$stateProvider
.state("template1", {
url: "/template1",
templateUrl: "template1.html",
controller: "tmp1Controller"
})
.state("template2", {
url: "/template2",
templateUrl: "template2.html",
controller: "tmp2Controller"
});
}
]);
routerApp.controller("mainCtrl", ["$scope",
function ($scope) {
}
]);
routerApp.controller("tmp1Controller", ["$scope",
function ($scope) {
}
]);
routerApp.controller("tmp2Controller", ["$scope",
function ($scope) {
}
]);
请告诉我我有什么问题。这是我在Plunker中的代码