2
如何AngularJS拼接變量值如何拼接AngularJS中的變量值?
HTML:
<div ng-repeat="steps in data" class="card" style="padding:10px 5px 10px 5px; margin-bottom:10px; margin-top:20px; background: url(@routes.Assets.at("images/Assets/icon_move.png")) no-repeat right #FAFBFC; background-position : calc(100% - 10px) 50%;">
{{steps.title}}
<div class="pull-right" ng-click="deleteStep(steps);" style="color:#F26063; padding-right: 40px;">Delete</div>
<a class="pull-right" ng-click="openAddStep('lg');" style="color:#43C944; padding-right: 20px;">Edit</a>
</div>
的JavaScript:
$scope.deleteStep = function(steps){
alert('h');
for (var i = $scope.steps.length - 1; i >= 0; i--) {
if (!$scope.steps[i].value) {
$scope.steps.splice(i, 1);
}
}
}