Hello Everyone, 

I am new to angularjs and mobile development. I was able to get the 
autoscroll to work on older android devices and apples devices. 

However, on newer android devices, autoscroll is not working. The reason I 
am under the impression it is the autoscroll because I have a check that 
checks if user is on their mobile device to check if its an android and so 
on and the autoscroll does not 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];


The following is where I am detecting if it is a device and if so, to 
autoscroll to view results. 
Any help would be appreciated as I am stumped why it is working on ios, 
desktop and older versions of 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 [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.

Reply via email to