davidbau / seedrandom

seeded random number generator for Javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot get it working in angular

kissenger opened this issue · comments

When inside a node app, Math.random is not available; instead you want

var seedrandom = require('seedrandom');
var rng = seedrandom(1);
console.log(rng());

Looks like the SO thread has answered the question; here is the fixed example from the thread:

https://stackblitz.com/edit/angular-thvcfa