我写了条件
onclick="window.open({{video_call_url}}, '_system', 'location=yes'); return false;"
这里video_call_url
在 Controller 中定义为 $scope.video_call_url = 'http://www.google.com/';
但是当我点击按钮时,我收到一个错误 video_call_url is not defined.
最佳答案
您可以在 Controller 中执行逻辑:
function myController($scope, $window) {
$scope.openVideoCallUrl = function() {
$window.open($scope.video_call_url, "_system", "location=yes");
return false;
}
}
在你看来
<a ng-click="openVideoCallUrl()">Open!</a>
关于angularjs - 如何在 angularJs 中使用 onClick?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40421822/