錯(cuò)誤提示:Argument of type 'number' is not assignable to parameter of type 'string'.
解決方法1: toString
//第一次遇到
var qishuyear= qishudate.getFullYear().toString(); //獲取完整的年份(4位,1970)
var qishumonth=(qishudate.getMonth()+1).toString(); //獲取當(dāng)前月份(0-11,0代表1月)
var qishuday=qishudate.getDate().toString(); //獲取當(dāng)前日(1-31)
//第二次遇到
var ApiUrl = AppConfig.ENV('api')+'order';
let headers = new Headers();
headers.append('Content-Type', 'application/x-www-form-urlencoded');
let options = new RequestOptions();
let body = new FormData();
body.append('number',number.toString());
body.append('bet',bet.toString());
body.append('multiple',multiple.toString());
解決方法1: 把javascript代碼改為angularjs
//從0-10的隨機(jī)數(shù)
錯(cuò)誤寫法:$random=parseInt(Math.random()*10);
$scope.random=Math.floor(Math.random()*10);
//PS: 從1-10的隨機(jī)數(shù)
$scope.random=Math.floor(Math.random()*10+1);