2
I’m trying to open a javascript page with Angularjs. I need that when I click on Bt it asks a question and depending on the result, open a link with the url true or false. I can do this, but the page only opens if I click the button again. Below is the code:
$scope.hasCodeIndication = function() {
    // $location.path('/register/true');
    swal({
        title: 'Código de indicação',
        text: 'Possuo código de indicação?',
        confirmButtonText: 'Sim',
        confirmButtonColor: '#16824d',
        closeOnConfirm: true,
        cancelButtonText: 'Não',
        showCancelButton: true,
        closeOnCancel: true,
        html: true
    },
    function(isConfirm) {
        if (isConfirm) {
            $location.path('/register/true');
        } else {
            $location.path('/register/false');
        }
    });
}
						
I got it made like this:
– Edinho Rodrigues