Search code examples
cssionic-frameworkionic-popup

How to remove title area from ionicPopup


I want to remove the title area from the ionic popup completely. I removed the title tag and tried. but still can see the title space visible. Here is my code.

 var registerPopup = $ionicPopup.show({

        templateUrl: 'templates/register_popup.html',

        scope: $scope

    });

Even if I remove the title tag completely, the title area is still visible with a blank space as shown in the image below. I want to remove the entire title space from the ionicPopup. How can I get it? what changes are to be made in the code?

enter image description here


Solution

  • It is because the title is wrapped inside .popup-head which takes the space.

    First add a value of custom-class to cssClass property in the Popup object.

    var registerPopup = $ionicPopup.show({
    
        templateUrl: 'templates/register_popup.html',
        cssClass: 'custom-class', // Add
        scope: $scope
    
    });
    

    You can hide it using custom CSS.

    .custom-class .popup-head {
      display: none;
    }