0
home.page.html
<ion-icon name="Send" size="small"></ion-icon>
<button ion-button icon-only (click) ="sendEmail()">
Send Email
</button>
home.pagets.
sendEmail() {
this.emailComposer.isAvailable().then((available: boolean) =>{
if(available) {
let email = {
to: '[email protected]',
attachments: [
],
subject: 'Started service order',
body: 'Foi aberto a ordem',
isHtml: true
}
// Send a text message using default options
this.emailComposer.open(email);
}
})
}
error:
PicturesPage.html:24 ERROR TypeError: Cannot read property 'then' of undefined
at PicturesPage.push../src/app/pictures/pictures.page.ts.PicturesPage.sendEmail (pictures.page.ts:69)
at Object.eval [as handleEvent] (PicturesPage.html:24)
at handleEvent (core.js:23107)
at callWithDebugContext (core.js:24177)
at Object.debugHandleEvent [as handleEvent] (core.js:23904)
at dispatchEvent (core.js:20556)
at core.js:21003
at HTMLButtonElement.<anonymous> (platform-browser.js:993)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
at Object.onInvokeTask (core.js:17290)
A simple email sending routine and do not know how to find solution, someone knows why this error happens?