user3362364
user3362364

Reputation: 477

Condition based on

I want to show "Complete it" if the value of pro_percent is less than 75.

    <progressbar class="progress-striped active" max="100" value="user.pro_percent" type="success">
            {{user.pro_percent | number:0 }}
    </progressbar>
    <span ng-show="user.pro_percent < 75">Complete it</span>

I can't get my head around to write the condition for ng-show. How should I go about here?

EDIT:

I added this functionality as suggested and got the following result.

    <div class="progress-striped active progress ng-isolate-scope" max="100" value="user.pro_percent" type="success">
      <div class="progress-bar progress-bar-success" ng-class="type &amp;&amp; 'progress-bar-' + type" role="progressbar" aria-valuenow="73.33" aria-valuemin="0" aria-valuemax="100" ng-style="{width: (percent < 100 ? percent : 100) + '%'}" aria-valuetext="73%" ng-transclude="" style="width: 73.33%;">
        <span class="ng-binding ng-scope">
            73%
        </span>
      </div>
    </div>
    <small ng-show="user.pro_percent < 75" class="ng-hide">Complete it</small>

Upvotes: 1

Views: 143

Answers (2)

Ori Drori
Ori Drori

Reputation: 191916

if user.pro_percent is a number then this should do it:

<span ng-show="user.pro_percent < 75">Complete it</span>

Upvotes: 1

Bidhan
Bidhan

Reputation: 10687

I think this should work just fine

<span ng-show="user.pro_percent < 75">Complete it</span>

Upvotes: 1

Related Questions