Hi folks,
I have a ionic/angularjs page containing a form into which 4 values are
entered, some stuff calculated, and the answers returned to a results block
positioned immediately above the submit button.
I use the $anchorScroll and $location service components to move to the top
of the results section (it's quite long). This works as expected, but when
I use the same services to move to the top of the page (as part of a form
reset), the page top is not reached at all.
My controller code is
myapp.controller('LeaderSprayingCtrl',function($scope,$location,$anchorScroll){
...
code for processing form
...
$scope.doClear = function(){
$location.hash('toplsc');
$anchorScroll();
$scope.dilutevol = $scope.canopy = $scope.bandwidth =
$scope.travelspeed = '';
}
});
The html is which I call the function is:
<button class="button button-small" ng-click=
"doClear(leadersprayingForm)">Clear all</button>
The target id is unique and is placed in the h1 tag at the top of the page
I cannot understand what I'm doing wrong - I've followed the same pattern
in terms of code and target in both instances, yet only one works.
Suggestions?
Thanks/Thomas
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.