AngularJS ng-open directive
AngularJS instance
Show or hide the <details> list by clicking on checkbox:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body ng-app="">Click here to display the details list: <input type="checkbox" ng-model="showDetails"><br><br><details ng-open="showDetails"> <summary>Learn not only technology, but also dreams! </summary> <p> - Rookie Tutorial</p></details><p><b>Note:</b> Currently, only Opera, Chrome, and Safari browsers support the details tag. </p></body></html>
Definition and usage
The ng-open directive is used to set the open property of the details list.
The details list is visible if the ng-open expression returns true.
grammar
<details ng-open="expression">...</details>
The <details> element supports this directive.
Parameter value
| value | describe |
|---|---|
| Expression | If the expression is true, the open property of details is set. |
The above is the information sorting out the AngularJS ng-open directive, and will be added later.