Adding a button to scroll top

Hi , I am trying to detect when the user scroll down…and show a button to top when clicked
I didn’t create a directive, I found it very difficult to understand so I am using Content

I have managed to scroll to top when the button is clicked


    var distance = this.content.scrollTop;

    if (distance > 0){

but I dont know how to show and hide the button… currently it is shown in the constructor this.showButton = true;

I want to show the button when scrollTop changes its value


Later response: Please have a look at this: