Я пытался найти идентификатор или имя определенной строки, которая генерируется из повтора. В этом случае я пытаюсь опубликовать конкретные строки invoice_no. К сожалению, я не уверен, что я делаю в этом случае.Поиск определенного значения из ng-повторяющейся строки
controller("myControllerMgmtVOM", ["myFactory", "$animate", "$timeout", "$q", "$http", "$filter",
function(myFactory, $animate, $timeout, $q, $http, $filter) {
var vm = this;
var setLoading = function(loading) {
vm.isLoading = loading;
};
vm.count = function(idx) {
console.log(idx);
};
setLoading(true);
$http.get("/index.php/Collections/getOpenAccountingAction/").then(function(res) {
vm.vom = [];
angular.forEach(res.data, function(val, idx) {
vm.vom.push({
invcase_id: val.invcase_id,
invoice_no: val.invoice_no,
obj_id: val.obj_id,
contact: val.contact,
customer: val.cname,
open_date: val.fcdate,
followup_name: val.followup_name,
followup_date: val.fdatetime,
company_name: val.company_name,
notes: []
});
});
}).then(function() {
angular.forEach(vm.vom, function(val, idx) {
$http.get("../Collections/getNote/?id=" + val.invcase_id).then(function(res) {
val.notes = [];
angular.forEach(res.data, function(note, idx) {
val.notes.push({
detail: note.note_text,
date: note.createddate
});
});
var orderBy = $filter('orderBy');
val.notes = orderBy(val.notes, '-date');
});
$http.get('/arinvoice/getamount?invoiceNo=' + val.invoice_no).then(function(response) {
vm.vom[idx].amount_due = '$ ' + response.data.Amount_Due;
vm.vom[idx].due_date = response.data.Due_Date;
});
});
setLoading(false);
});
vm.hideRow = function(rowID) {
//var rowID = vm.vom.invoice_no;
$http.post("/index.php/Collections/closeAction/?id=" + rowID).then(function(res){
window.location = "/index.php/Collections";
});
};
}
]);
Ниже передний конец:
<div class="marginBottom inline-flex">
<md-button class="md-raised md-primary pad-10" href="" data-ng-click="clickSearch='1'">Search</md-button>
</div>
<div layout layout-sm="row" class="search-container pad-10 vanish" data-ng-show="clickSearch=='1'">
<md-input-container flex>
<md-button class="md-primary md-raised pos-abs-right" data-ng-click="search=''">Clear</md-button>
<md-button class="md-primary md-raised pos-abs-right" data-ng-click="clickSearch=''">Close</md-button>
<label for="search">Keyword Search</label>
<input name="search" id="search" type="text" data-ng-model="search" />
</md-input-container>
</div>
<div layout='row' class="stripeRow">
<div flex class="pad-10 stripeTeal">
<strong><a href="" data-ng-click="prop = 'open_date'; reverse=!reverse">Open Date</a></strong>
</div>
<div flex class="pad-10">
<strong><a href="" data-ng-click="prop = 'invoice_no'; reverse=!reverse">Invoice Number</a></strong>
</div>
<div flex class="pad-10 stripeTeal">
<strong><a href="" data-ng-click="prop = 'invcase_id'; reverse=!reverse">Invoice Case ID</a></strong>
</div>
<div flex class="pad-10">
<strong><a href="" data-ng-click="prop = 'amount_due'; reverse=!reverse">Amount Due</a></strong>
</div>
<div flex class="pad-10 stripeTeal">
<strong><a href="" data-ng-click="prop = 'due_date'; reverse=!reverse">Due Date</a></strong>
</div>
<div flex class="pad-10">
<strong><a href="" data-ng-click="prop = 'customer'; reverse=!reverse">Customer/Company</a></strong>
</div>
<div flex class="pad-10 stripeTeal">
<strong><a href="" data-ng-click="prop = 'contact'; reverse=!reverse">Customer Contact</a></strong>
</div>
<div flex class="pad-10">
<strong><a href="" data-ng-click="prop = 'followup_name'; reverse=!reverse">Assigned To</a></strong>
</div>
<div flex class="pad-10 stripeTeal">
<strong><a href="" data-ng-click="prop = 'followup_date'; reverse=!reverse">Next Follow-up Date</a></strong>
</div>
<div flex class="pad-10 ">
<strong><a href="" >Close</a></strong>
</div>
</div>
<md-list>
<md-item data-ng-repeat="row in vm.vom | orderBy:prop:reverse | filter:search" class="moving finish" data-ng-class-odd="'stripeGrey'" data-ng-class-even="'stripeWhite'" data-ng-init="visible=''">
<md-item-content ng-show="row.amount_due!= '$ 0.00'" layout="row" class="vom">
<div flex>{{::row.open_date}}</div>
<div flex>{{::row.invoice_no}}</div>
<div flex><a href="/index.php/Collections/edit/?id={{::row.invcase_id}}">{{::row.invcase_id}}</a></div>
<div flex>{{::row.amount_due}}</div>
<div flex>{{::row.due_date}}</div>
<div flex><a href="/index.php/Collections/cust_list/?id={{::row.obj_id}}">{{::row.customer}}</a></div>
<div flex>{{::row.contact}}</div>
<div flex>{{::row.followup_name}}</div>
<div flex>
{{::row.followup_date}}
<span class="float-r point vanish formContainer">
<i class="fa fa-file-o" data-ng-mouseenter="visible=row[$index]"></i>
<div class="toolTip main-bg" data-ng-mouseleave="visible=''">
<md-content class="md-padding vanish" data-ng-repeat="option in row.notes" data-ng-show="visible==row[$index]">
<h5>{{option.date}}</h5>
<p>{{option.detail}}</p>
</md-content>
</div>
</span>
</div>
<div flex><md-button class="sm-raised sm-primary pad-10" href="" data-ng-click="vm.hideRow(row.invcase_id)">close</md-button></div>
</md-item-content>
<md-divider data-ng-if="!$last"></md-divider>
</md-item>
</md-list>
Поэтому в основном я пытаюсь захватить значение, что строки val.invoice_no и опубликовать его. Может кто-нибудь объяснить, что я могу изменить? Благодарю.
Вау, это всегда мелочи. Я скорректировал свой код выше, чтобы отразить мои изменения. Благодарю. – jcdevelopment