Tutorials References Exercises Bootcamp Menu
Sign Up Create Website Get Certified Pro

AngularJS ng-open Directive


Show / Hide a <details> list by clicking a checkbox:

<input type="checkbox" ng-model="showDetails">

<details ng-open="showDetails">
    <summary>Copyright 1999-2016.</summary>
    <p> - by Refsnes Data. All Rights Reserved.</p>
Try it Yourself »

Definition and Usage

The ng-open directive sets the open attribute of a details list.

The details list will be visible if the expression inside the ng-open attribute returns true.


<details ng-open="expression">...</details>

Supported by the <details> element.

Parameter Values

Value Description
expression An expression that will set the element's open attribute if it returns true.