我获得了一个在UI中显示的JSON序列化字符串。我想基于一些参数将特定属性显示为超链接。解决这个问题的最佳方式是什么?
答案 0 :(得分:0)
使用ng-href
<a ng-href="{{valueFromController}}">link</a>
在角度控制器中,
$scope.valueFromController = "https://www.google.com"; // change the value according to your conditions.
答案 1 :(得分:0)
ng-href
(参见文档here)
您可以在html标记中定义链接,如此
<a ng-href="http://www.gravatar.com/avatar/{{yourJsonObject.property}}">link1</a>
其中yourJsonObject
是$ scope