This is the duplicate question but I am not able to understand what exactly I am doing wrong in my code. It's a very basic angular app but the routing not working and also not invoking the controller. I am not finding anything wrong in the code.
EDIT: Here is the Plunker
app.js:
var appRoot = angular.module('smapp', ['ngRoute']);
appRoot.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/Home', { templateUrl: '/views/home.html', controller: 'OmdbCtrl' })
.when('/', { templateUrl: '/views/home.html', controller: 'OmdbCtrl' })
.otherwise({ redirectTo: '/' });
}
]);
controller:
appRoot.controller('OmdbCtrl', ['$scope', 'OmdbFactory', function ($scope, OmdbFactory) {
$scope.test = 'working';
}]);
Index.html:
<!doctype html>
<html ng-app>
<head>
<title>My Angular App</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body>
<div class="container-fluid">hi
<ng-view class="view-slide-in" ng-cloak=""></ng-view>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.11/angular.min.js"></script>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.11/angular-route.min.js"></script>
<script src="./js/app.js"></script>
<script src="./js/factory.js"></script>
<script src="./js/OmdbCtrl.js"></script>
</body>
</html>
home.html
<div class="row">
<div class="col-lg-12"><h4>{{test}}</h4></div>
</div>

ng-app="smapp". Just to be clear...are you loading this page from a server...localhost or web?/views/home.htmltoviews/home.html