Marcus Edensky
Marcus Edensky

Reputation: 944

AngularJS not working on some browsers/devices

I'm using Angular on my site, but I've been having reports on it often not working. Often users have to try different browsers/devices to get it to work. On my computer it works fine on Chrome, Opera and Firefox, latest versions. I've had reports of the page not working for visitors when using Firefox (version 31.6.0) and Safari though.

I have a smartphone of brand Öwn (Chilean or Peruvian I think), and the angular code does not work on this phone. I've tried using Chrome and the Öwn browser (some browser of their own). I have expandable content powered by jQuery, and that works fine, so it's definitely only Angular the page has problems with.

I tried removing all dependencies (using ngAnimate and ui.bootstrap for datepicker, and ngDialog), but still doesn't work on my phone.

I'm sorry I don't have more details. This is the page where the problems happen: https://www.easterisland.travel/tours/

Does anyone have a clue? Thank you!

Upvotes: 2

Views: 3937

Answers (1)

Marcus Edensky
Marcus Edensky

Reputation: 944

The problem in the end was in the code of an Angular function. When declaring a new object, I hadn't applied a value to one of the variables. This:

var tourObj = {groupId: groupId, pricePP: pricePP, savingsPP};

should have been this:

var tourObj = {groupId: groupId, pricePP: pricePP, savingsPP: savingsPP};

It was tricky since some browsers accepted it (Chrome and later Firefox) but many didn't. To locate the problem I checked error console of Safari Mac, and all it said was that angular.min.js.map and angular-animate.min.js.map were missing. .map files are for showing debug messages with minified code. Once the .map files had been added (find .map files for angular here, clicking folder for your angular version), the error console showed me exact location of the error.

Upvotes: 2

Related Questions