angular 绑定html

来源:互联网 发布:java去掉括号内容 编辑:程序博客网 时间:2024/06/05 15:59
ng-class 与class 区别{ red:true,yellow:true } 与之相比更好控制样式
$scope.style='{color:red,backgroud:yellow}'{{style}}


ng-style 与ng-href={{url}} ng-src=''
$scope.url="www.baidu.com"
$scope.src='img.s'
ng-attr-(suffix) html 属性可以
ng-attr-titile() 也会解析成title 必须传参
ng-show  ng-show='s'
$scope.s=true
ng-if  //dom 对 操作,删除 false 
ng-switch 
ng-switch-default
ng-switch-when 
ng-open 与detail 结合
ng-bind 只能绑定一个
ng-bind-teamplate{{text}} 解决ng-bind的兼容性问题
ng-bind-html='h2' 会不生效
一定要有一个插件sanitize
var app=angular.module('myApp',['sanitize'])