简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM