【发布时间】:2017-07-06 18:34:48
【问题描述】:
我正在 angularjs 中移动我的 mvc 应用程序。 我在应用程序中有不同的区域。我想使用 MVC 路由在区域之间移动。我想在每个区域内使用 Angular 路由。
所以在我的服务器中我有默认的路由配置......而在我的角度我有以下配置:
.config(function ($routeProvider, $locationProvider) {
var viewBase = '/Views/AngularTemplates/';
$routeProvider
.when('/Servizi/Cpe/New', {
templateUrl: viewBase + 'Cpes/insert.html',
controller: 'cpesController'
})
.when('/Servizi/Cpe', {
templateUrl: viewBase + 'Cpes/list.html',
controller: 'cpesController'
});
$locationProvider.html5Mode(true);
})
Servizi 是我的区域,Cpe 是该区域的控制器...当我从 /Servizi/Cpe 移动到 /Servizi/Cpe/New 时,它可以工作,因为它是由 angular 管理的。
但我无法从 /Home 移动到 /Servizi,因为它是由 MVC 路由管理的。
怎么办?
【问题讨论】:
标签: angularjs asp.net-mvc routing asp.net-mvc-routing