Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(findState) for undefined stateName #980

Closed
wants to merge 1 commit into from

Conversation

george-i
Copy link

In combination with angular translate, sometimes 'stateName' is undefined.

@nateabele
Copy link
Contributor

Returning undefined is the expected behavior. Can you explain a bit more about why this is necessary, or show some code that demonstrates the problem you're trying to solve?

@george-i
Copy link
Author

angular-translate -> https://github.com/angular-translate/angular-translate
I believe that angular-translate has a conflict with ui-router, at least in my configuration.
The 'stateName' argument is undefined when is passed to 'findState' function.
The highlighted code throws the error.

  function findState(stateOrName, base) {
    var isStr = isString(stateOrName),
        name  = isStr ? stateOrName : stateOrName.name,
        path  = isRelative(name);

In Google Chrome developer console this is the message:

TypeError: Cannot read property 'name' of undefined

@christopherthielen
Copy link
Contributor

@nateabele
Copy link
Contributor

http://run.plnkr.co/jfkrDCICUVcb5bdV/

Says "Not Found". I think I get the gist from the comment though. I was just confused because I don't see what angular-translate has to do with it.

@christopherthielen
Copy link
Contributor

oops, yeah I didn't know run.plnkr.co times out.

http://plnkr.co/edit/062FOEDaOWz3VP3xXn4l?p=info

@nateabele nateabele closed this in 456fd5a Mar 26, 2014
@george-i
Copy link
Author

A colleague corrected me; the issue wasn't with the translation module, but:

'when there is a navigation point which has no ui-state'

Thanks for fixing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants