Search code examples
angularjsionic-popup

show Ionic Popup automatically without any button click in ANgularJS


I have an ionic popup which works fine on ng-click. But how do I make it appear automatically when my start page appears?

I know I need to write code in $scope.init(). However, I am new to ionic. Can anyone help me? Thanks!


Solution

  • Use the following code,

     $scope.$on('$ionicView.enter', function(e) {
        callpopup();
     })
    

    This $ionicView.enter will execute, whenever you are opening the your view.Refer:http://ionicframework.com/docs/api/directive/ionView/