ので、私は第二グループ非表示とNG-リピートangularJSにおけるオブジェクトごとのみの入力フィールドを表示
ので、私のhtmlのためのショーと非表示ボタンを超える繰り返していた場所と説明の入力フィールドのグループを持っています:
<div ng-repeat="location in vm.locations" class="row">
<div class="form-group col-md-12">
<label for="location">Location</label>
<input type="text" class="form-control" name="location" ng-model="location.name">
<a class="pull-right" ng-click="vm.showLocationDetail()">Add Description</a>
</div>
<br>
<div ng-show="vm.showDetail" class="form-group col-md-12">
<textarea class="form-control" type="text" name="description" rows="5" ng-model="location.description"></textarea>
</div>
</div>
コントローラ:私は場所の1つの以上のフィールドを持っていると私は説明を追加]をクリックした場合
// toggle location details
vm.showLocationDetail = function() {
return vm.showDetail = !vm.showDetail;
}
は今...すべてのフィールドは、説明の入力フィールドを示しています。
関連する説明フィールドのみを表示するにはどうすればよいですか?