ionicPopup and templateUrl parameter

Hello! Why parameter templateUrl of ionicPopup don’t looking specified file in folder and working only if template writes in the main html code?

Example:
not work with file roll-timer-popup.html in folder templates:

var alertPopup = $ionicPopup.show({
        scope: $scope,
        title: 'Work!',
        templateUrl: '/templates/roll-timer-popup.html'
    });

work:

var alertPopup = $ionicPopup.show({
        scope: $scope,
        title: 'Work!',
        templateUrl: 'roll-timer-popup.html'
    });

In index.html:

<script id="roll-timer-popup.html" type="text/ng-template">
            <div class="text-center"><h3><timer autostart="false" interval="1000" countdown="5" id="timer2">{{mminutes}}:{{sseconds}}</timer></h3></div>
        </script>

Have you tried using

templateUrl: 'templates/roll-timer-popup.html'

I am not sure where your templates directory is at but mine is directly under www/ and this is how I reference each template file in my JS.

Yes, I tried this. I also put template in www folder and it is not working. When template must be calling I receive error in IE console:

Error: Access is denied

at Anonymous function (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:117:166)
at m (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:113:465)
at Anonymous function (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:111:197)
at Anonymous function (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:142:415)
at k.prototype.$eval (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:156:294)
at k.prototype.$digest (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:153:390)
at Anonymous function (file://C:/Users/Stanislav/www/js/ionic.bundle.min.js:156:388)
at e (file://C:/Users

But I’m on Windows and all file rights is correct.

I put template in www folder and start app in PhoneGap Developer App on my smartphone. And it is work! Problem exists only on desktop IE. Thanks!

1 Like

templateUrl : ‘/scripts/delivery/home-delivery/validation.html’

works perfectly in browser but not working in mobile. any suggestion??
how i need to define path of html file.