Modal not working on iOS


#1

Hi,

I’ve built a modal using the example on codepen (http://codepen.io/ionic/pen/gblny?editors=001) and I can’t get it to work once it’s built for iOS. It works just fine on the browser and even on the phonegap tester app, it just doesn’t work when compiled for iOS.

Any clues?

Thanks in advance!


#2

Hmm not a whole lot to go on…

Are you getting any errors? Can you remote debug with safari and see whats in your console?


#3

Ok, remote debugging with safari helped me figure out what was up, thanks for the tip.

The modal.html which I had included using <script id="modal.html" type="text/ng-template"> (like in the example) wasn’t loading. What I did was move the code inside the <script> tag into a new template called modal.html and changed the route in the controller.js to:

$ionicModal.fromTemplateUrl('templates/modal.html', function(modal) {
    $scope.modal = modal;
  }

and it worked. Thanks for thelp!