I use a Math.random() function in a AngularJS Code
$scope.runFull = function () {
var rand;
do {
rand = Math.random();
...
} while ($scope.cond < 5400); // 90 minutes
};
$scope.runFull();
My Chrome console return javascript TypeError: Math.random is not a function
I put Math in watcher and I find Math.abs, Math.acos, Math...., Math.random, Math....
My error was : angular.module('xxxxxApp') .controller('FullController', function ($scope, $interval, xxxxService, yyyyService, ..., Math, Principal) {
YES, thank you very much everyone, I have a angularjs service named "Math".
Solution: I rename my "Math" service in "Mathematic" and I can use Math.random() :)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments