I keep encountering an error message that says "angular.min.js:6Uncaught Error: [$injector:modulerr]" whenever I try to implement $templateCache in my app.config block. Interestingly, when I remove the $templateCache parameter from app.config, the errors disappear. Can someone please point out what I might be missing? Thanks in advance.
var app = angular.module("app", ['ui.router'], function () {
console.log('Application Initiated Successfully...');
})
.run(function ($templateCache, $http) {
console.log("app is running");
$http.get("Views/home2.html", { cache: true }).success(function (html) {
$templateCache.put("Test.html", html);
console.log($templateCache.get("Test.html"));
});
console.log($templateCache.info());
});
app.config(['$stateProvider', '$urlRouterProvider', '$locationProvider', '$templateCache', function ($stateProvider, $urlRouterProvider, $locationProvider, $templateCache) {
$urlRouterProvider.otherwise("/");
$stateProvider
.state("/", {
url: "/",
templateUrl: "Views/home.html"
});
}]);
app.controller("indexController", ["$rootScope", "$scope", function ($rootScope, $scope) {
console.log('indexController');
$scope.message = "Hi lets get started...";
} ]);