Delete with ng-if?
Delete with ng-if?
我在一个有角度的html页面上列出故事,如下所示:
<li class="myStories" ng-repeat="story in authors.currentAuthor.stories | orderBy: '-_id'">
<!-- <span ng-if="checked" class="animate-if"> -->
Title: {{ story.title }}<br>
Genre: {{ story.genre }}
<a ui-sref-active="active" ui-sref="storyEdit({ id: story._id })"
id="{{ story._id }}">Edit Story
</a>
</li>
Angular文档声明"如果表达式返回false,ng-if指令将删除DOM元素",所以我想知道使用ng-if删除项是否可能/合法?
该项仅从DOM中删除。它仍在您的数据表示中。对于视觉上的东西,它是合法的,而且大多数时候都比ng show好——看:什么时候喜欢ng if而不是ng show/ng hide?
相关文章:
- 我需要NG-IF/NG-SWITCH还是NG-SHOW&NG-HIDE
- 如何应用带过滤器的ng if来过滤记录,并在同一页面中显示两个不同的视图
- 在 ng-if 编译后访问指令中的 DOM 元素
- 通过ng-if设置隐藏文本框的值
- AngularJS ng-if指令在移除元素之前,即使条件为false,也会短暂呈现
- 使用 ng-if 时 ng 类的标记行为
- 为什么更改范围获胜'不能在ng if内部工作,而是通过函数调用AngularJS
- Angular2 ng if有什么问题
- 为什么myForm$提交的不适用于ng消息,但适用于ng if
- ng if不验证函数
- 将默认选项添加到ng-if
- 通过使用ng if更新ng repeat加载程序
- ng-if 连续执行方法
- 如何在使用$http缓存时重新触发ng-if/ng显示动画
- 从指令中向元素添加ng-if属性
- angularjs ng if中的无限循环
- Delete with ng-if?
- AngularJS Function with ng-if inside ng-repeat
- ng-if indexOf with JSON Arrays
- Ng-if with animated class不能和ng-mouseover一起工作