菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://cdn.staticfile.org/angular.js/1.4.6/angular.min.js"></script> </head> <body ng-app=""> <div ng-init="myVar = 'http://www.facesoho.com'"> <h1>小鸟启蒙</h1> <p>访问 <a ng-href="{{myVar}}">{{myVar}}</a> 学习!</p> </div> <p>该实例可以使用了原生的 href 属性,但在 AngularJS 中, ng-href 属性更安全。</p> </body> </html>
运行结果