AngularJS ng-href 指令
AngularJS 教程
· 2019-04-01 17:38:56
AngularJS 实例
使用 AngularJS 设置添加链接:
<div ng-init="myVar = 'http://www.codercto.com'">
<h1>码农教程</h1>
<p>访问 <a ng-href="{{myVar}}">{{myVar}}</a> 学习!</p>
</div>
<h1>码农教程</h1>
<p>访问 <a ng-href="{{myVar}}">{{myVar}}</a> 学习!</p>
</div>
定义和用法
ng-href 指令覆盖了原生的 <a> 元素 href 属性。
如果在 href 的值中有 AngularJS 代码,则需要使用 ng-href 而不是 href。
ng-href 指令确保了链接是正常的,即使在 AngularJS 执行代码前点击链接。
语法
<a ng-href="string"></a>
<a> 元素支持该指令。
参数值
| 值 | 描述 |
|---|---|
| expression | 字符串,表达式的执行结果 |
点击查看所有 AngularJS 教程 文章: https://www.codercto.com/courses/l/36.html
GWT in Action
Robert Hanson、Adam Tacy / Manning Publications / 2007-06-05 / USD 49.99
This book will show Java developers how to use the Google Web Toolkit (GWT) to rapidly create rich web-based applications using their existing skills. It will cover the full development cycle, from ......一起来看看 《GWT in Action》 这本书的介绍吧!