How Abstract States works at the angular

Asked

Viewed 65 times

3

I’m working on an APP and I’m still getting to know the features of angular.

I have a route file and I was suggested to add the parameter abstract: true to prevent browsing by url. However I have been searching more about it and I don’t understand very well what it actually does.

None of what I read says that it prevents browsing by url. So I’d like to know what the real functionality of this property is?

  • Angularjs or Angular2? They are two different things.

  • I thought it was the same. But in my case it is for the Angularjs. I will edit!

1 answer

2

A practical example might illustrate some possibilities.

Imagine you have an application where access to a given state is controlled by permissions - for example, #/usuarios is a state that displays the user list, but only users with admin permission can view it.

You can create an abstract state - acessoNegado, for example - that is invoked when the state usuarios is accessed without proper permissions.

Thus, the URL present in the browser remains #usuarios, but the user is viewing the content of #acessoNegado.

  • this part was clear to me now. But this access would be a control variable. For example: 'Abstract: accessNegado'?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.