Math functions in AngularJS bindings

You have to inject Math into your scope, if you need to use it as
$scope know nothing about Math.

Simplest way, you can do

$scope.Math = window.Math;

in your controller.
Angular way to do this correctly would be create a Math service, I guess.

Leave a Comment