AngularJS's ng-click parameter passing method

陈政宽~
Release: 2018-05-30 14:51:24
Original
6108 people have browsed it

This article mainly introduces the ng-click parameter passing method ofAngularJS. The editor thinks it is quite good. Now I will share it with you and give it as a reference. Let’s follow the editor to take a look.

I encountered a problem today, which is the ng-click parameter transmission problem. I found a lot of information on the Internet, so I left a note first

  • {{item.transAmount}}

    已分配:{{item.usePoints}}

    授信方:{{item.rollOutAccountName}}

    授信日期:{{item.createTime}}

Copy after login
//js代码 $scope.sentOutQuery = function(sourceDetail){ var expiresDate= new Date(); expiresDate.setTime(expiresDate.getTime() + 2*1000); $cookieStore.put("sourceDetailId", sourceDetail,{expires : expiresDate}); console.log(sourceDetail); window.location.href='sentOutQuery.html'; }
Copy after login

ng-click=" sentOutQuery('{{item.detailId}}')" In this way, although the debugger can see the passed parameter value on the page, theeventclick is invalid, as shown below;

Only by directly introducing the parameters in the click event can the parameters be obtained in the corresponding JS code

The above is the detailed content of AngularJS's ng-click parameter passing method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!