Whenever I try to load my controller
, I keep getting an error.
I have double-checked all my files, but I can't seem to figure out where the mistake lies. Can anyone help me with this?
This is my html file:
<!DOCTYPE html>
<html ng-app="tcpApp">
<head>
<meta charset="utf-8>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<base href="/">
<title>TCP App</title>
<link rel="stylesheet" href="css/lib/fonts.css">
<link rel="stylesheet" href="css/lib/reset.css">
<link rel="stylesheet" href="css/tcp.css">
</head>
<body>
<div class="wrapper" ng-view></div>
<!--Libs -->
<script src="js/lib/jquery/dist/jquery.min.js"></script>
<script src="js/lib/angular/angular.min.js"></script>
<script src="js/lib/angular-resource/angular-resource.min.js"></script>
<script src="js/lib/angular-route/angular-route.min.js"></script>
<!--scripts -->
//controller loaded first
<script src="js/script/controllers/homeController.js"></script>
<script src="app.js"></script> //app file
</body>
</html>
This is my app.js :
"user strict";
var tcpAppHolder = angular.module("tcpApp", ["ngRoute"]);
tcpAppHolder
.config(function ($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider
.when ("/home", {
templateUrl : "views/home.html",
controller : "homeController" //home controller loaded
});
$routeProvider
.otherwise ({
templateUrl : "views/home.html",
controller : "homeController"
});
});
This is my homecontroller.js file:
"use strict";
angular.module("tcpApp.controllers")
.controller("homeController", function ($scope) { //controller being loaded
console.log("i am from home");
});
This is the error I am encountering:
Uncaught Error: [$injector:nomod] http://errors.angularjs.org/1.4.0/$injector/nomod?p0=tcpApp.controllers