angularjs - ionicModal Cannot call method 'fromTemplateUrl' of undefined -


i using ionic display modal, here example code:

angular.module('starter', ['ionic'])     .controller('mycontroller', ['$scope', function($scope,$ionicmodal){         $ionicmodal.fromtemplateurl('my-modal.html', {             scope: $scope         }).then(function(modal) {             $scope.modal = modal;         });          $scope.openmodal = function() {            $scope.modal.show();         }; 

when run code, got error message saying typeerror: cannot call method 'fromtemplateurl' of undefined. how can fix it?

you missed $ionicmodal after $scope

  .controller('mycontroller', ['$scope','$ionicmodal', function($scope,$ionicmodal){ 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -