AngularJS中页面间传值

1.使用url传值

页面间,可以使用url传值,例如:

HTML:


JS:

$scope.onGotDetail=function(pNo)
{
      window.location.href="detail.html?pNo="+pNo;
};
url如 http://1.1.1.1/report.html?pNo=123使用这样的方法可以在跳转页面同时传递一个url上面的pNo=123参数给目的页面。

对于多个参数:

window.location.href="detail.html?id="+id+"&key="+key;



你可能感兴趣的:(AngularJS,web)