lakshay lakshay - 5 months ago 51
AngularJS Question

How to use onClick with angularJs?

I have written a condition

onclick="{{video_call_url}}, '_system', 'location=yes'); return false;"

is definded in myController as
$scope.video_call_url = '';

but when i click the button i am getting an error
video_call_url is not defined.


You can do the logic in the controller:

function myController($scope, $window) {
    $scope.openVideoCallUrl = function() {
        $$scope.video_call_url, "_system", "location=yes");
        return false;

And in your view

<a ng-click="openVideoCallUrl()">Open!</a>