0

Here is my angular module and route

var app = angular.module('app', ['ngRoute']);

app.config(['$routeProvider', function($routeProvider) {
    $routeProvider.when('/photo', {
        templateUrl: 'templates/photo.html',
        controller: 'PageController'
    })
}])

When I run my app getting error as

error: [$injector:modulerr] Failed to instantiate module ngRoute due to:

I have used this angularjs gem

Can any one help to solve this issue.

1 Answer 1

2

ngRoute is a separated module since some (maybe 1.2) version of AngularJS. gem includes all modules, you just have to require needed ones in your application.js:

//= require angular
//= require angular-route

Here is the list with all available modules:

//= require angular
//= require angular-animate
//= require angular-cookies
//= require angular-loader
//= require angular-mocks
//= require angular-resource
//= require angular-route
//= require angular-sanitize
//= require angular-scenario
//= require angular-touch
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.