Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

AngularJS ng-open Directive


Example

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>
</details>
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.


Syntax

<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.