I'm trying to set up basic angular routing with a Firebase app and am having difficulty
My index.html is:
<html ng-app="SampleApp">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.17/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.20/angular-route.min.js"></script>
<script src="https://cdn.firebase.com/js/client/1.0.18/firebase.js"></script>
<script src="https://cdn.firebase.com/js/simple-login/1.6.3/firebase-simple-login.js"></script>
<script src="https://cdn.firebase.com/libs/angularfire/0.8.0/angularfire.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<nav class="navbar>My Navbar</nav>
<div ng-view></div>
</body>
</html>
My views/main.html is
<div>Main.html</div>
My dependencies are
var app = angular.module('sampleApp', ['ngRoute', 'firebase', 'ui.bootstrap']);
My config is
app.config(function($routeProvider, $locationProvider) {
$routeProvider.
when('/app/doctors', {
templateUrl: 'views/main.html',
controller: 'SampleCtrl'
}).
otherwise({
redirectTo: '/'
});
$locationProvider.html5Mode(true);
})
I should also add that the folder structure is
project
app
views
main.html
app.js
index.html
Whenever I try to hit
localhost:8000/app/doctors I get a 404 Error.
If I go to localhost:8000/app I am redirected to localhost:8000. If I go to localhost:8000 I see the directory structure and can click app to go index.html and the route is rewritten as localhost:8000
I've also tried localhost:8000/#/app/doctors and no luck there