I am unable to get the autoscroll to work on android devices, especially 
samsung s6 and above (using s7 and doesnt work)

The following is my controller:

function(){
var $scope, $location, $anchorScroll;
var indexApp = angular.module('indexApp',['ui.bootstrap', 'ngSanitize']);

indexApp.controller('IndexController',function($scope,$http,$location,$anchorScroll,anchorSmoothScroll){
$scope.Lang = 'initVal';
$scope.ShowResults = false;
$scope.ShowDesc = true;
$scope.NoResults = false;
$scope.currentPage = 1;
$scope.maxPageNumbersToShow = 10;
$scope.formModel = {};
$scope.searchMode = 0;
$scope.miles = [{'value':'5'},{'value':'10'},{'value':'15'},{'value':'20' 
}];
$scope.Specialties = [{'value':'Family practice'},{'value':'General 
practice'},{'value':'Internal medicine'},{'value':'Pediatrics'}];
$scope.Gender = [{'value':'Male'},{'value':'Female'}];
//$scope.Languages = {};
$scope.Cities = {};
$scope.searchParam = {};
$("input").removeAttr('disabled');
$scope.searchParam.Distance = $scope.miles[0];


And the following is where I check if it is a mobile device and if it is, 
autoscroll to results. Any help would be appreciated as I am stumped with 
why it works on some devices and not for Samsung s6 or other android devices
$scope.providers = response.data.provider;
$scope.resultsCount = response.data.rowCount;
if (navigator.userAgent.match(/Android/i) || 
navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) 
||
navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || 
navigator.userAgent.match(/BlackBerry/) 
|| 
navigator.userAgent.match(/Windows Phone/i) || 
navigator.userAgent.match(/ZuneWP7/i) || 
navigator.userAgent.match(/SAMSUNG|SGH-[I|N|T]|GT-[I|P|N]|SM-[N|P|T|Z|G]|SHV-E|SCH-[I|J|R|S]|SPH-L/i))
 
{
if (!$scope.providers){
$scope.NoResults = true;
$scope.ShowResults = false;
$scope.ShowDesc = false;
$location.hash('error');

// call $anchorScroll()
$anchorScroll('error');
}
else {
$scope.NoResults = false;
$scope.ShowResults = true;
$scope.ShowDesc = false;
$location.hash('ResultsAnchor');

// call $anchorScroll()
$anchorScroll('ResultsAnchor');
}
}
else{
if (!$scope.providers){
$scope.NoResults = true;
$scope.ShowResults = false;
$scope.ShowDesc = false;
}
else {
$scope.NoResults = false;
$scope.ShowResults = true;
$scope.ShowDesc = false;
} 
}

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to