xxxxxxxxxx
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.net/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
<div ng-init="myVar = 'https://www.runoob.com/wp-content/uploads/2014/06/angular.jpg'">
<h1>Angular</h1>
<img ng-srcset="{{myVar}}">
</div>
<p>该实例可以使用原生的 srcset 输出,但是使用 AngularJS 代码插入值,使用 ng-srcset 属性更好。</p>
</body>
</html>