Hello I am new in angular JS and Onsen UI. i have problem $anchorScroll not working if only i back to page1 in index.html. everything is fine if i refresh browser. in index.html i have two page :
- page1. there is button to navigate to page2
- in page2 i have number list : from 1 to 20. After open page2 automatically scroll to list number 5 and the $anchorScroll is working fine.
$scope.scrollTo = function(elementId) {
$timeout(function() {
$location.hash(elementId);
$anchorScroll();
});
};
init();
function init(){
$scope.scrollTo('no-5');
}
in bottom on the list i have OK button that is back to page1 (index.html) the code is
$scope.back = function(elementId) {
$scope.myNavigator.pushPage('index.html');
};
- The problem is after i back to page1 and then navigate to page2 again. this $anchorScroll is not working. why this is happen? i have written the code in codepen the link is below
http://codepen.io/lapisan/pen/LGbbJL