我有以下内容:
var app = angular
.module('app', ['admin', 'home', 'questions', 'ui.compat', 'ngResource', 'LocalStorageModule'])
.config(['$stateProvider', '$locationProvider', function ($stateProvider, $locationProvider) {
$locationProvider.html5Mode(true);
}])
.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) {
$rootScope.$state = $state;
$rootScope.$stateParams = $stateParams;
// $state.transitionTo('home.overview');
$state.transitionTo('home', { contentTitle: 'overview' })
}]);
我想要做的是在'app'模块中添加一个控制器。是否可以这样做 链接,如果是这样,我应该怎么做?
答案 0 :(得分:1)
angular.module('app', ['admin', 'home', 'questions', 'ui.compat',
'ngResource', 'LocalStorageModule']).controller('Ctrl',
['$scope', function($scope) {
$scope.greeting = 'Hola!';
}]);