私は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'}
);
}]);