<html>
<script src="https://cdn.staticfile.net/angular.js/1.6.9/angular.min.js"></script>
<body ng-app="">
<div ng-init="myVar = 'https://www.w3school.com.cn'">
<h1>教程</h1>
<p>访问 <a ng-href="{{myVar}}">{{myVar}}</a> 以进行学习!</p>
</div>
<p>此例可以使用原始的 href 属性,但在 AngularJS 中,使用 ng-href 属性更安全。</p>
</body>
</html>