angular.js - How to pass multiple parameters through url in angularjs?
世界只因有你
世界只因有你 2017-05-15 16:51:25
0
1
658

HTML:

<a ng-click="onGoDetail(y.id);"><img ng-src="imgurl/1.jpg" /></a>

JS:

$scope.onGotDetail=function(pNo)
    {
      window.location.href="detail.html?pNo="+pNo;
    };

URL such as http://1.1.1.1/report.html?pNo=123 Using this method, you can pass the pNo=123 parameter on a url to the destination page while jumping to the page, but what if you want to pass multiple parameters at once? For example, there are 2 parameters, one id and one key. How to write the HTML page? How to write js page? I have just come into contact with angularjs, so I would like to ask my seniors for guidance.

世界只因有你
世界只因有你

reply all(1)
大家讲道理

Introduction.
If you pass multiple parameters, just spell multiple parameters:

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

Of course, since you use angular, just use angular$location,

See also: $location

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template