+1
Answered

Modals working fine in Codeflow but not on Platform Emulator or Device

Foxy 2 years ago in Ionic Framework • updated by Todd 2 years ago 2

My app is using Ionic modals and works fine in codeflow but I get a salesforce error page when running on the platform emulator.


After debugging, the problem seems to be with this;


$ionicModal.fromTemplateUrl("templates/signature.html", {
  scope: $scope,
  animation: 'slide-in-up'
}


The 'modal' object doesn't contain the signature.html content but it has salesforce error page.

Any ideas, please?

Answered

@Foxy, ah yes - this is something that I need to document.


The issue is caused by a conflict in the way the template is referenced and served by Salesforce. The way around this is to include the modal template inside a script tag inside the parent template. An example of this can be seen in this codepen - https://codepen.io/calendee/pen/AHIuh/.