0

I'm trying to pass some markup to the cordova email plugin like so:

window.cordova.plugins.email.open({
  to: '', 
  subject: 'Test',
  body: '<p>Test body</p>',
  isHtml: true
});

This works fine, but I need to pass a lot more markup in the body property, and from what I understand, this kind of thing should be in a view, rather than the controller. So I've been trying various methods to load a view and pass it to the plugin.

Reading this post about using $templateCache and $compile), I could do something like this:

var template = $templateCache.get('email-results.html');
var email = $compile(template)($scope);

The email var is an object after this code with the right info in it, but accessing the properties of this object not only feels wrong, but also doesn't work very well because the markup still has angularjs expressions in it.

Community
  • 1
  • 1
alexkb
  • 3,216
  • 2
  • 30
  • 30
  • Do you mean you need the data in angularjs controller to pass into a cordova plugin? – Reza Feb 21 '15 at 14:17
  • By 'data' do you mean model? Yes, there are references to the model in email-results.html, but these are in expressions which don't seem to be interpreted regardless of whether the model is used or not. – alexkb Feb 22 '15 at 02:56

0 Answers0