我大致知道在AngularJS路由定義發生如下:分佈式路由定義
var app = angular.module('app', []);
app.config(function ($routeProvider) {
$routeProvider.when("/", { templateUrl: "/partials/home.html" }).
when("/profile", { templateUrl: "/partials/profile.html" }).
when("/contact", { templateUrl: "/partials/contact.html" }).
otherwise({ redirectTo: '/' });
});
什麼惱火的是,我想用RequireJS模塊化我的申請,我想註冊需要的地方的路線。例如,如果我有一個配置文件模塊,我想從那裏註冊我的路線。同樣適用於聯繫人模塊。這種集中化讓我瘋狂。我在這裏錯過了一個觀點,還是有什麼好的解決方案來解決我的問題?
@Stewie你是對的 - 我沒有找到這個 –