How to set the scroll of a DIV to the top in an IONIC app
Hi,
I have a div that contains lists.
The div enables the user to scroll up and down the list, and when a button is pressed I want the scroll to go to the top so the top of the list is displayed.
I've found the some code to do this, but unsure how it fits into the Appery codebase and am looking for guidance please.
The div is called camlist_div, I presume I need to set a controller for the div (as this is mentioned in the code below) but I have no idea where to start.
code
Controller Code
.controller('DashCtrl', function($scope, $ionicScrollDelegate) {
Code: Select all
$scope.scrollTop = function() {
$ionicScrollDelegate.scrollTop();
};
})
/code