如何使 ng-repeat 中的按钮在 ionic 和 angularfire 中打开完整的 url link?

How to make a button in ng-repeat open a full url link in ionic and angularfire?

假设我在我的控制器中使用它

var messagesRef = firebase.database().ref().child("messages");
$scope.messages = $firebaseArray(messagesRef);

而在我的 html 中是

 <li ng-repeat="message in messages">
<p>{{ message.user }}</p>
<p>{{ message.text }}</p>
<button href="{{ message.weblink }}">OPEN THIS LINK</button>

例如,{{website.weblink}} 来自我的 firebase 数据库 www.google.com。

我怎样才能使该按钮起作用以使用该按钮打开 www.google.com,因为它不起作用。

总而言之,应该使用 <a ng-href=""> 而不是 <button href="">

Using Angular markup like {{hash}} in an href attribute will make the link go to the wrong URL if the user clicks it before Angular has a chance to replace the {{hash}} markup with its value. Until Angular replaces the markup the link will be broken and will most likely return a 404 error. The ngHref directive solves this problem. - ngHref