Help with ng-if and server script

robhaas
Tera Contributor

I have a list of items and each has an order. I have another variable that is set to the current record's order. I am trying to print all items that have been completed thus far. So for example:

List:

LabelOrder
Step11
Step22
Step33
Step44

I query this table and push all rows into something named steps. I also get the current record's step number and store it in a variable steps.rec. Example:

steps.rec = 3;

In my html, I have an ng-repeat:

<div ng-repeat="step in c.data.steps">

This if followed up with a ng-if:

<div ng-if="steps.order <= steps.correct">

                          {{steps.label}}

                      </div>

The problem here is that I am only printing the current record label, not the ones before it. I should be printing Step1, Step3, Step3. I am only getting step3. Any thoughts?

6 REPLIES 6

robhaas
Tera Contributor

So I ended up scrapping the ng-if and just using the ng-repeat with a filter. I set 2 filters in my client controller. This seems to work the way I need it for now and I will continue to work on making it more efficient and then share.


Kim Sullivan
Tera Guru

@robhas - Did you ever get this working?  I'm having the same trouble in a portal widget.  Thanks!