N
N
Nikolai Shvetsov2017-01-07 11:00:54
Angular
Nikolai Shvetsov, 2017-01-07 11:00:54

Why is a request not sent to the server when clicking on a link?

I started to make a project, requests from the form (for example, login or registration) go away and work out correctly. But the problem is this:
There is a link to logout, angular follows this link, but the request in laravel does not go away, and when you update with a link, logout leaves. I assigned href, ng-href, click, ng-click and the corresponding function in the controller, but this function does not even enter ... How is it configured? To send a request to the backend by the link?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ozknemoy, 2017-01-25
@ozknemoy

<a href ng-click="$ctrl.logout()">....
in controller

this.logout = function() {
    httpService.post('').then(/*logout angular front and refresh page*/)
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question