this is my updated code :
on controller just add this function :
function Version(id, app){
this.id = id;
this.app = app;
}
and update this function :
vm.getApplicationByVersion = function (id) {
if(id != null){
ApplicationService.getApplicationByVersion(id, countApplicationByVersion)
.then(
function (applicationByVersion) {
vm.applicationByVersion.push(new Version(id, applicationByVersion));
},
function (data) {
console.log(data)
}
);
}
}
view for the category :
<div class="application-category-list col-md-9">
<ul>
<li ng-repeat-start="version in ctrl.applicationVersion | orderBy: 'id'"
ng-repeat-end ng-init="ctrl.getApplicationByVersion(version.id)">
<div class="row">
<div class="application-category">
<h4>{{version.name}}</h4>
</div>
</div>
<application-per-version></application-per-version>
</li>
</ul>
</div>
view for the details :
<div class="row">
<ul class="application-card-list" ng-repeat-start="version in
ctrl.applicationByVersion | filter: { id: version.id}" ng-repeat-end>
<li class="col-xs-12 col-sm-3 col-md-2" ng-repeat-start="application in
version.app" ng-repeat-end>
<div class="application-card-box">
<div class="application-card-image">
<a ng-href="{{ctrl.pathApplicationDetail + application.id}}"><img
ng-src="{{ctrl.assetsUrl + application.image}}" alt=""></a>
</div>
<div class="application-card-body">
<a ng-href="{{ctrl.pathApplicationDetail + application.id}}"><p
class="application-card-title">{{application.name}}</p></a>
<p class="application-card-subtitle">{{application.version.name}}</p>
<p class="application-card-version">{{application.number}}</p>
</div>
</div>
</li>
</ul>
</div>
i think this is not the best solution. but for this time i just found this
way...
Pada Senin, 25 Juli 2016 08.06.47 UTC+7, Paijo RX menulis:
>
> finally i am using array. thanks
>
> On Fri, Jul 22, 2016 at 9:38 PM, Sander Elias <[email protected]>
> wrote:
>
>> Hi Paijo.
>>
>> Every row has it's own 'scope' (dont' use that!!) Most of what you need
>> is taken care of automatically. But you have only 1 controller, and if you
>> want to store multiple variants for multiple rows, you can store it in the
>> data of the row itself, or keep an parallel array.
>>
>> Regards
>> Sander
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "AngularJS" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/angular/Qb84aYryMG0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at https://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.