【发布时间】:2015-01-28 12:00:29
【问题描述】:
我是 Angular 新手,我正在尝试模块化我的应用程序。
我的主模块得到了一些其他模块,我想在我的路由定义中使用注入模块的控制器。 一些简单的例子会很有帮助!
这不起作用:
var app = angular.module('Contacting_App', ['LeadLookup']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/main',
{controller: 'MainCtrl',
templateUrl: 'apex/f42_Contacting_Main'}
).
when('/lead',
{module: 'LeadLookup',
controller: 'LeadLkpCtrl',
templateUrl: 'apex/f42_Lead_Lookup'}
).
otherwise(
{redirectTo: '/main'}
);
}]);
【问题讨论】:
标签: angularjs angularjs-routing angularjs-module