Ionic: how to use cssClass in $ionicPopup?

后端 未结 1 1940
说谎
说谎 2020-12-31 18:48

So I want to modify the default width in $ionicPopup and to do so I have to add \'cssClass\' to my popup object just like the code below

  $scope.getScore =          


        
1条回答
  •  隐瞒了意图╮
    2020-12-31 19:23

    Just define a mother class and override .popup default ionic class inside this way

       .my-custom-popup{
          .popup{
            //styling for popup width, width: 300px;
          }
          .popup-title{
            //styling for title
          }
        }
    

    and pass my-custom-popup in cssClass

     var popupScore = $ionicPopup.alert({
    
      title:'Score',
      template: 'Total XP points: 50',
      cssClass: 'my-custom-popup',
      buttons: [{
        text:'Return',
        type: 'button-assertive'
      }]}}
    

    Here is the list of classes which you can override or customize in your parent class

    • .popup

    • .popup-head

    • .popup-title

    • .popup-sub-title

    • .popup-body

    • .popup-buttons.row

    • .popup-buttons .button

    0 讨论(0)
提交回复
热议问题