当我点击下面图片中的星星时,我会做以下的事情,
<td>{{x.name}}</td>
<td>
<div ng-click="starHovered($event)" class='pointer fg-blue'>{{x.star}} </div>
<div title='Click to add star' class='displayNone'><input type="text-box" placeholder="Enter comments" class='commentsValue' ng-model='commentsValue'/><img ng-click="starLeft($event,commentsValue)" class='pointer' src='images/add.png' height='30px'/></div>
</td>
$scope.starLeft = function(x,commentsValue,name){
if(commentsValue =='' || commentsValue == undefined){
alert('please enter comments');
return;
}
alert(name)
}如何在第一个单元格、相应行的名称列或**中获取值
从DOM中的任何容器中获取文本
**我知道jquery,有人能提出类似于数据属性或jquery对象表数据的建议吗?
发布于 2016-04-15 06:44:00
$scope.starLeft = function(event,commentsValue, name){
if(commentsValue =='' || commentsValue === undefined){
alert('please enter comments');
return;
}
alert(name)
}<td>{{x.name}}</td>
<td>
<div ng-click="starHovered($event)" class='pointer fg-blue'>{{x.star}} </div>
<div title='Click to add star' class='displayNone'><input type="text-box" placeholder="Enter comments" class='commentsValue' ng-model=commentsValue/><img ng-click="starLeft($event,commentsValue, x.name)" class='pointer' src='images/add.png' height='30px'/></div>
</td>
https://stackoverflow.com/questions/36639684
复制相似问题