I'm having some headaches, because I need to create a function that allows validating when the link should redirect to the location or when it should not, for example, I'm loading an image and clicking the link should not load, I created a function
I'm having some headaches, because I need to create a function that allows validating when the link should redirect to the location or when it should not, for example, I'm loading an image and clicking the link should not load, I created a function
I do not quite understand your question, but if you want to do something only when the page is fully loaded you can use $ viewContentLoaded .
Example:
Controller:
var redirecionar = false;
$scope.$on('$viewContentLoaded', function() {
redirecionar = true;
console.log("Rota carregada")
});
$scope.acessar = function() {
if (redirecionar) {
console.log("Página Carregada! Redirecionando..")
//implementar redirecionamento
} else {
console.log("Pagina não carregada!")
}
}
View:
<a href="" ng-click="acessar()">Clique Aqui!</a>