0

So I have an ng-if that looks like this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p style="margin-left: 2px;font-style: italics;font-family: 'Roboto', sans-serif; font-size: 12px;color: #818A8F;" ng-bind="'(' + progress + '%' + ' ' + 'complete)'"></p>

<div ng-if="progress == 100">
  <i class="material-icons x{{$index}}" style="position: relative; bottom: 100px; left: 600px; cursor: pointer;" ng-click="vm.removeFile($index)">close</i>
  <br>
  <div class="input-field col m2 l2">
    <input placeholder="First eye exam" id="desc{{$index}}" type="text" class="validate square-box" style="width: 400px !important;">
    <label for="desc{{$index}}" class="active">Description</label>
  </div>
</div>

When the ng-if is triggered, I want to hide the p thats right above the ng-if (and other stuff in the html as well)

I tried something like

<div ng-if="progress=100"><script>$('p').hide();</script></div>

but obviously that didnt work. whats the correct way of doing this?

1 Answer 1

2

Just add

ng-hide="progress == 100" 

to all the elements you want to hide. Angular will take care of hiding them when the condition is satisfied.

Sign up to request clarification or add additional context in comments.

1 Comment

worked great. very simple. thanks. ill accept this as the answer in a few min

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.