Ionic modal click?


#1

Hello im trying to call a button click from modal but seams to not work…

  $scope.LoginModalWindow = null;
  $ionicModal.fromTemplateUrl("templates/view/login.html", {
  $scope: $scope
  }).then(function (LoginModalWindow) {
  $scope.LoginModalWindow = LoginModalWindow;
  });
  $scope.OpenLoginModalWindow = function () {
  $scope.LoginModalWindow.show();
  };
  $scope.HideLoginModalWindow = function(){
  $scope.LoginModalWindow.hide();
  };
  $scope.Login = function(){
   console.log("login!");
  }


            <button class="button button-light login-buttons" translate="li" ng-click="Login()">
            </button>

#2

In your options the variable name should be scope, not $scope. E.g.:

$ionicModal.fromTemplateUrl("templates/view/login.html", {
  scope: $scope
})

#3

Me stupidoooooooooo replace all… ;D thx for clear look :slight_smile: