akhil viswam
akhil viswam

Reputation: 516

Where should i put the html files for angular routing?

var myapp = angular.module('myApp', ['ngCookies','ui.bootstrap','ngTouch','ui.bootstrap-slider','ngRoute']);
myapp.config(function($interpolateProvider,$locationProvider,$routeProvider) {
$routeProvider.when('/overview', {
               templateUrl: '/mysite/mdm/mdm_overview.html',
               controller: 'AddStudentController'
            }).
            when('/dashboard', {
               templateUrl: '/mysite/mdm/mdm_dashboard.html',
               controller: 'AddStudentController1'
            }).  
           otherwise({
              redirectTo: '/overview'
           });

When I run this code following error occurs:

Unknown provider: $templateRequestProvider <- $templateRequest <- $route <- ngViewDirective

What is the actual problem? Do I need to put the html file inside static folder?

Upvotes: 0

Views: 163

Answers (1)

Su93
Su93

Reputation: 81

Make sure to include angular.js and angular-route.js files. And the files should be in same versions. angular.js - v1.3.0-rc.5 angular-route.js - v1.3.0-rc.5

Upvotes: 1

Related Questions