unserver-unify
Version:
23 lines (21 loc) • 621 B
JavaScript
;
angular.module('bamboo')
.controller('SendMsgDlgCtrl', function($scope, sendTo, ApiService, CommonService, $translate) {
var self = this;
this.sendTo = sendTo;
this.sendmessage=function(){
var info={
action:"sendp2p",
target:self.sendTo.userid,
message:self.newmessage,
}
ApiService.post('/messages' ,info).then(function(result) {
console.log(result);
if (result.data.success) {
CommonService.showNoBlockInfo($translate.instant('Send Successful!'));
self.newmessage="";
$scope.$close();
}
});
}
});