I am trying to combine ui-router and angular-materialize in my project. But whenever I try to add the angular materialize module, I encounter this error in the console:
Error: [$injector:modulerr] ...
script.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) {
}
]);
Please help me identify what could be causing this issue. You can view my code on Plunker