0

So I have a list of notices in AngularJS which I create with ng-repeat. The notices have a visibility status which determines whether the notice is shown in the list. Every notice has controls which allow that notice to be hidden, a simple button that changes the notice.status.visibility to false.

I also have a checkbox input that is supposed to show hidden notices. However, I am unsure on how to implement this and how would it work.

Here's the HTML:

<ul>
    <input type="checkbox" value="Show Hidden" />
    <li ng-repeat="notice on notices | filter: filter.search">
        <div ng-show="notice.status.visibility">
            <!-- notice details -->
        </div>
    </li> 
</ul>

1 Answer 1

2

Maybe with something like this:

<ul>
    <input type="checkbox" value="Show Hidden" ng-model="showHidden" />
    <li ng-repeat="notice on notices | filter: filter.search">
        <div ng-show="showHidden || notice.status.visibility">
            <!-- notice details -->
        </div>
    </li> 
</ul>
Sign up to request clarification or add additional context in comments.

1 Comment

Obviously my guestion was way too simple :D Thank you!

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.