[英]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
未知提供者:$ templateRequestProvider <-$ templateRequest <-$ route <-ngViewDirective
What is the actual problem? 实际问题是什么? Do I need to put the html file inside static folder?
我需要将html文件放在静态文件夹中吗?
Make sure to include angular.js and angular-route.js files. 确保包括angular.js和angular-route.js文件。 And the files should be in same versions.
并且文件应为相同版本。 angular.js - v1.3.0-rc.5 angular-route.js - v1.3.0-rc.5
angular.js-v1.3.0-rc.5 angular-route.js-v1.3.0-rc.5
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.