我是angularjs的新手,我们正在使用angularJs AMD。
的index.html
<div ng-controller=“MainController">
<div ng-include src="'sidepanel.html'"></div>
</div>
app.js
'use strict';
define(['angularAMD', 'ui-router', 'ui_bootstrap', 'jquery-ui', 'angularModalService', 'bootstrapjs'], function (angularAMD) {
var app = angular.module("sampleApp", ['ui.router', 'ui.bootstrap', 'angularModalService']);
//Main Controller
app.controller('MainController', ['$scope', '$rootScope', '$timeout', '$state', '$window',
function ($scope, $rootScope, $timeout, $state, $window) {
$rootScope.sampleTest = 'Welcome Test';
}]);
app.config(['$stateProvider', '$locationProvider', '$urlRouterProvider', function ($stateProvider, $locationProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise('/home');
$stateProvider.state('Home', {
url: '/home',
views: {
'content': {
templateUrl: 'views/home.html',
controller: 'HomeController'
}
}
});
}]);
// Bootstrap Angular when DOM is ready
angularAMD.bootstrap(app);
return app;
});
我的问题在这里。
如何在此处编写侧面板控制器。
示例github:https://github.com/marcoslin/angularAMD/tree/master/www