想用angular里的routeProvider和template来做content部分的视图切换,为什么这样写并不能实现?代码如下。
PS后台非NODE
index.html
...
...
route.js:
var myApp = angular.module('myApp',['ngRoute']);
myApp.config(['$routeProvider',function($routeProvider){
$routeProvider
.when('/',{
templateUrl:"page/home/homePage.html",
controller:"contentController"
})
.otherwise({
redirectTo: '/'
});
}]);
myApp.controller("contentController",function(){
...
});
homePage.html:
...
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...