S.B
S.B

Reputation: 329

Angularjs calculation not working on safari on iPad / iPhone

I have a calculation in AngularJS which calculates a cost. It works fine in all browsers (that i have tested on) except from Safari on iPads and iPhones.

The calculation looks like this:

£ {{ ((((((((height * width) / 1000000) * square_meter_price) + panel_price) * 1)) * (1 + (lookup.dl_markup-0) + (Colours.options.markup-0))) + (lookup.dl_extra_cost-0) + (Colours.options.extra_cost-0) + (hingeholesno * hinge_hole_price)) * panel_quantity | number : 2 }}

On safari on iPad / iPhone it displays the above code rather than the cost (overall calculation)

Any ideas on how to resolve this would be greatly appreciated as i've searched for hours with no joy.

Upvotes: 0

Views: 273

Answers (1)

S.B
S.B

Reputation: 329

i resolved this by using $watch in the controller:

    $scope.$watch('((((((((height * width) / 1000000) * square_meter_price) + panel_price) * 1)) * (1 + (lookup.dl_markup-0) + (Colours.options.markup-0))) + (lookup.dl_extra_cost-0) + (Colours.options.extra_cost-0) + (hingeholesno * hinge_hole_price)) * panel_quantity | number : 2', function(fc) {$scope.FullCost = fc;});

Then using {{FullCost}} in the HTML - it now works and displays in all devices

Upvotes: 0

Related Questions