我正在寻找从控制器更新范围值的“ng-href”url。最初在页面加载 url 上插入很好。但是当我更改应该更新 URL 的范围时
<a ng-href=={{selectedValue}} /a>
//in my controller
$scope.selectedValue = "www.google.com"
//need to update this url in this function
otherButtonFn = function(){
//want to Update the url here
$scope.selectedValue = "www.yahoo.com"
}
//ng-href is loading initial url but not updating when $scope is called
<a ng-href=="www.google.com" href=""www.google.com" /a>
在这里,我想在调用该函数时使用“www.yahoo.com”更新网址。