来源:http://hbiao68.iteye.com/blog/22834
ng-click="shareGoods({{item.goods_id}},$event)" 传递一个$event对象
通过事件对象 $event.target 获取事件源
-
- $scope.addPackage = function(myevent,deviceType){
-
- var htmlObj = $(myevent.target).closest(".float_left");
- var deviceName = htmlObj.find("div.font_16").html();
- var jsonObj = {
- "deviceType":deviceType,
- "deviceName":deviceName
- };
-
- if(!this.hasDevice(deviceType)){
-
- this.lists.push(jsonObj);
- }
- };