2

I'm trying to change the value as well as the style of the subText attribute associated with an $ionicPopup somewhere in my app.

I searched everywhere, but didn't find yet any method for doing so.

So how is that possible?

Thanks.

user6039980
  • 3,108
  • 8
  • 31
  • 57

2 Answers2

3

If you want to change popup after it been shown, you can use selectors and angular jqlite wrapper.

Code is like this

onTap: function(e) {
          var result = document.getElementsByClassName("popup-sub-title");

           angular.element(result).html('dsaadsds')
           e.preventDefault();
        }

You have here a working codepen.

Ygalbel
  • 5,214
  • 1
  • 24
  • 32
0

You cannot change the subTitle directly using the configuration option, as by defined in the specification it accepts an optional String value

{
title: '', // String. The title of the popup.
cssClass: '', // String, The custom CSS class name
subTitle: '', // String (optional). The sub-title of the popup.
}

UPDATE:

You can assign a value to a $scope property within onTap to assign a success message

{
    text: '<b>Save</b>',
    type: 'button-positive',
    onTap: function(e) {
      $scope.success = {
        message: 'Hello World!'
      };

      e.preventDefault();
    }
  }

And now you can access $scope.success.message to show the success message

Aditya Singh
  • 15,810
  • 15
  • 45
  • 67