var app=angular.module('kaifanla',['ng','ngRoute']);
app.config(function($routeProvider){
//添加路由
$routeProvider
.when('/文件名',{
templateUrl:'tpl/start.html',
controller:'startCtrl'
})
.when('/文件名',{
templateUrl:'tpl/main.html',
controller:'mainCtrl'
})
.when('/文件名',{
templateUrl:'tpl/detail.html',
controller:'detailCtrl'
})
.when('/文件名/:id',{
templateUrl:'tpl/detail.html',
controller:'detailCtrl'
})
.when('/文件名',{
templateUrl:'tpl/order.html',
controller:'orderCtrl'
})
.when('/文件名/:id',{
templateUrl:'tpl/order.html',
controller:'orderCtrl'
})
.when('/文件名',{
templateUrl:'tpl/myOrder.html',
controller:'myOrderCtrl'
})
.otherwise({redirectTo:'/文件名'});
});
转载于:https://www.cnblogs.com/dianzan/p/7284340.html