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

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -