I have the simplest ui.router example which doesn't seem to work.
See below:
var routerApp = angular.module('mainApp', ['ui.router']);
routerApp.config(function($stateProvider, $urlRouterProvider) {
//$urlRouterProvider.otherwise('/home'); When I uncomment this, it loads /home without a problem but why is it going to the "otherwise" condition?
$stateProvider
.state('home', {
url: '/home',
templateUrl: 'main.html'
})
});
My index file.
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.8/angular-ui-router.min.js"></script>
<script src="/angular/angularApp.js"></script>
</head>
<body ng-app="mainApp">
<div class="container">
<div ui-view></div>
</div>
</body>
</html>
I have been going on and on into this but I think I now have tunnel vision. Someone please help me out here. Thanks in advance!