How to generate Random Number in angularjs?

There is a need when we want a random number to be generate when we load the page or when we call a particular method.

When we load the page we can use this auto generated  number as a PIN or SessionID or any other things as per our need.


JS Page:


Return function(input,scope){

If(input!=null && input!=undefined && input>1){

Return Math.floor(Math.random()*input)+1);