发表于: 2017-01-02 23:19:30
0 1688
今天完成的事:
1,按着原型图写修真院10期任务审核列表页面
2,学习了ng-options 指令
3,学习了AngularJS输出html
明天计划的事:
1,完成任务审核列表页面
2,完成任务审核详情页ctrl
3,完成任务审核列表页html
遇到的问题:
暂无
收获:
1,学习了ng-options 指令,ng-options 指令用于使用 <options> 填充 <select> 元素的选项
语法:
<select ng-options="array expression"></select>
<details> 元素支持该指令,array expression 数组中为 select 元素填充选项的表达式。
2, 用AngularJS输出html
<div class="col-md-12 ng-binding" ng-bind-html="item.content ">
用指令 ng-bind-html来html的输出时,并不起作用,浏览器中显示的还是html代码
可以采用通过$sce服务来输出html
angular.module("list",[]).controller("BlogListCtrl", BlogListCtrl).filter(
'to_trusted', ['$sce', function ($sce) {
return function (text) {
return $sce.trustAsHtml(text);
}
}]
)
<div class="col-md-12 ng-binding" ng-bind-html="item.content|to_trusted ">
评论