(fix) DI annotation of sgIMAP controller

This commit is contained in:
Francis Lachapelle 2015-07-28 14:37:49 -04:00
parent d7aae0e667
commit 433983e7c4

View file

@ -7,7 +7,6 @@
/** /**
* sgIMIP - A directive to handle IMIP actions on emails * sgIMIP - A directive to handle IMIP actions on emails
* @memberof SOGo.MailerUI * @memberof SOGo.MailerUI
* @ngInject
* @example: * @example:
*/ */
@ -15,40 +14,46 @@
return { return {
restrict: 'A', restrict: 'A',
link: link, link: link,
controller: controller controller: 'sgImipController'
}; };
function link(scope, iElement, attrs, ctrl) { function link(scope, iElement, attrs, ctrl) {
ctrl.pathToAttachment = attrs.sgImipPath; ctrl.pathToAttachment = attrs.sgImipPath;
} }
}
controller.$inject = ['$scope', 'User']; /**
function controller($scope, User) { * @ngInject
var vm = this; */
sgImipController.$inject = ['$scope', 'User'];
function sgImipController($scope, User) {
var vm = this;
$scope.delegateInvitation = false; $scope.delegateInvitation = false;
$scope.delegatedTo = ''; $scope.delegatedTo = '';
$scope.searchText = ''; $scope.searchText = '';
$scope.userFilter = function($query) { $scope.userFilter = function($query) {
return User.$filter($query); return User.$filter($query);
}; };
$scope.iCalendarAction = function(action) { $scope.iCalendarAction = function(action) {
var data; var data;
if (action == 'delegate') { if (action == 'delegate') {
data = {receiveUpdates: false, data = {
delegatedTo: $scope.delegatedTo.c_email}; receiveUpdates: false,
} delegatedTo: $scope.delegatedTo.c_email
};
}
$scope.message.$imipAction(vm.pathToAttachment, action, data); $scope.message.$imipAction(vm.pathToAttachment, action, data);
}; };
}
} }
angular angular
.module('SOGo.MailerUI') .module('SOGo.MailerUI')
.controller('sgImipController', sgImipController)
.directive('sgImip', sgImip); .directive('sgImip', sgImip);
})(); })();