Search code examples
ionic-frameworkangular-directive

Programmatically attach scroll="false" for ion-content


Is there any way to programmatically attach scroll="false" attribute for ion-content, with the help of a directive or other?

We need to hide the default behavior of ionic scroll while the application loading in web.

Thanks..


Solution

  • You have to use

    $ionicScrollDelegate

    .

    $ionicScrollDelegate.$getByHandle('Add Your div Handle').
     getScrollView().options.scrollingY = false; 
    

    For more reference, http://ionicframework.com/docs/v1/api/service/%24ionicScrollDelegate/