ui-router icon indicating copy to clipboard operation
ui-router copied to clipboard

Problem with unique names

Open mglavall opened this issue 9 years ago • 1 comments

I have read the documentation and saw this:

Naming Your States No two states can have the same name. When using dot notation the parent is inferred, but this doesn't change the name of the state. When explicitly providing a parent using the parent property, state names still must be unique. For example, you can't have two different states named "edit" even if they have different parents.

What I don't understand is why it doesnt show any error when I configure, for example :

contact.details.form
frontpage.form

The statename "form" is repeated, but it doesnt show any error and works as expected. So I dont understand why two states can't have the same name, and why It doesn't show any error.

Thank you

mglavall avatar Jan 11 '17 12:01 mglavall

That's a great question, and shows that the documentation could use some improvement.

The reason is that the name property on your state is what has to be unique. Your two states contact.details.form and frontpage.form are not equal. The warning in the documentation is for users who use parent: 'contact.details', not those who use "dot notation".

christopherthielen avatar Jan 11 '17 19:01 christopherthielen