2

我正在尝试更改与我的应用程序中某处的 $ionicPopup 关联的 subText 属性的值和样式。

我到处搜索,但还没有找到任何方法。

那怎么可能呢?

谢谢。

4

2 回答 2

3

如果要在显示后更改弹出窗口,可以使用选择器和角度 jqlite 包装器。

代码是这样的

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

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

这里有一个工作的codepen。

于 2016-05-25T10:36:51.957 回答
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

于 2016-05-25T11:01:31.923 回答