Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  8] [ 6]  / answers: 1 / hits: 16595  / 9 Years ago, mon, june 8, 2015, 12:00:00

I have linked the script in my index.html, and referenced it in app.js, but I keep getting the error that ngRoute is not available. Any help would be greatly appreciated!



app.js



angular.module('gameMaster', ['ngRoute', 'castServices']);


.config



angular.module('gameMaster')    
.config(function($routeProvider, $locationProvider){
$routeProvider
//welcome page
.when('/welcome', {
templateUrl: '../../../../pages/welcome.html',
controller: 'gameController'
})

//gameplay page
.when('/gameplay',{
templateUrl: '../../../../pages/gameplay.html',
controller: 'gameController'
})

//default to welcome
.otherwise({
redirectTo: '/welcome'
});
$locationProvider.html5mode(true);
});


index.html



<html>
<head>
<title>Party Things!</title>
<script type=text/javascript src=https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js></script>
<script type=text/javascript src=https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-route.js></script>
<script type=text/javascript src=https://www.gstatic.com/cast/sdk/libs/receiver/2.0.0/cast_receiver.js></script>
<script type=text/javascript src=node_modules/underscore/underscore.js></script>
<script type=text/javascript src=js/modules/castServices/castServices.js></script>
<script type=text/javascript src=js/modules/gameMaster/app.js></script>
</head>


Does anything jump out at you?



Thanks!


More From » angularjs

 Answers
17

It turns out that I had caching issues. I went into the developer options and disabled cache while the pane was open, and viola. Thanks for your help!


[#66279] Saturday, June 6, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tierney

Total Points: 45
Total Questions: 101
Total Answers: 94

Location: Sudan
Member since Thu, May 7, 2020
4 Years ago
;