angularjs ng-open 指令
angularjs 实例
通过点击 checkbox 显示或隐藏 <details> 列表:
<!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=""> 点击这里显示 details 列表: <input type="checkbox" ng-model="showdetails"><br> <br> <details ng-open="showdetails"> <summary>学的不仅是技术,更是梦想!</summary> <p> - 菜鸟教程</p> </details> <p><b>注意:</b> 目前只有 opera, chrome, 和 safari 浏览器支持 details 标签。</p> </body> </html>
定义和用法
ng-open 指令用于设置 details 列表的 open 属性。
如果 ng-open 的表达式返回 true 则 details 列表是可见的。
语法
<details ng-open="expression">...</details>
<details> 元素支持该指令。
参数值
值 | 描述 |
---|---|
expression | 如果表达式为 true 则会设置 details 的 open 属性。 |
以上就是对angularjs ng-open 指令的资料整理,后续继续补充。
如对本文有疑问, 点击进行留言回复!!
解决三元运算符 报错“SyntaxError: can''t assign to conditional expression”
解决angular 使用原生拖拽页面卡顿及表单控件输入延迟问题
使用 Angular RouteReuseStrategy 缓存(路由)组件的实例代码
分享Angular http interceptors 拦截器使用(推荐)
网友评论