<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>angular</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script src=""></script>
<script src=""></script>
<link href="">
<script src="" type="text/javascript"></script>
</head>
<body ng-app="app">
<script type="text/javascript">
var app = angular.module("app",[]);
</script>
<div>
<div>
ng-src和ng-href的使用(如果使用src或者href的话,HTML初始化的时候就会加载,肯定是不行的)
</div>
<div ng-controller="srcCon">
<a ng-href="{{logo}}" >
<img ng-src="{{logo}}" />
</a>
</div>
<script type="text/javascript">
app.controller("srcCon", function($scope) {
$scope.logo = "";
});
</script>
</div>
</body>
</html>
如何操作页面的样式,这个直接改绑定的数据模型就好了:
复制代码 代码如下: