Failed to instantiate module error in Angular js
angularjs, javascript
Solution
You need to include `angular-route.js` in your HTML:
<script src="angular-route.js">
http://docs.angularjs.org/api/ngRoute
Problem
I encountered the following error with a root cause of Module 'ngRoute' is not available Uncaught Error: [$injector:modulerr] Failed to instantiate module Amail due to: Error: [$injector:modulerr] Failed to instantiate module ngRoute due to: Error: [$injector:nomod] Module 'ngRoute' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument." Javascript code : ``` var amailServices = angular.module('Amail',['ngRoute']); function emailRouteConfig($routeProvider) { $routeProvider. when('/', { controller: ListController, templateUrl : 'list.html'}). when('/view/:id',{ controller : DetailsController, templateUrl:'detail.html'}). otherwise({ redirectTo:'/' }); } amailServices.config(emailRouteConfig); ``` How to fix this