这是ngcordova里边的一个发送邮件的插件,具体的使用方法为:
(参考文档:http://ngcordova.com/docs/plugins/emailComposer/)
1.首先下载插件:
cordova plugin add https://github.com/katzer/cordova-plugin-email-composer.git
2.在控制器中
module.controller('feedbackCtrl'
, [
'$scope', '$cordovaEmailComposer'
, function ($scope, $cordovaEmailComposer) {
$scope.sendFeedback = function (feedback) {
if (!feedback || feedback.length < 8) {
$scope.displayErrorMessage = true;
return;
} else {
var email = {
to: '@163.com',
subject: 'bd360 feedback',
body: feedback,
isHtml: false
};
$cordovaEmailComposer.open(email);
$scope.feedbackModal.hide();
}
};
}
]
);
3.在html文件中点击引用此函数即可。