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

html5mode not tested #149

Closed
clkao opened this issue May 26, 2013 · 18 comments
Closed

html5mode not tested #149

clkao opened this issue May 26, 2013 · 18 comments

Comments

@clkao
Copy link

clkao commented May 26, 2013

angularjs 1.1.5 breaks ui-router when used in html5mode. It'd be nice to have that captured by our tests.

When html5mode is enabled in sample, things work until you reload the page in deep state, for example you can navigate to http://localhost:3333/contacts/42 correctly, but reload breaks it, because appbase now /cotacts and path is just /42 instead of /contacts/42.

angular/angular.js#2799

@RomanMinkin
Copy link

That fixed in AngularJS v1.0.7

@nateabele
Copy link
Contributor

If we need anything more extensive than this, please explain accordingly.

@naturalethic
Copy link

This seems still busted in angular master branch. Do you know which changeset fixed it?

@nateabele
Copy link
Contributor

Okay, I don't know anything about Angular HEAD, but we're using this in production with 1.1.5 in HTML5 mode. If you're not running the app in the root of your domain, check the caveats listed in the FAQ.

@naturalethic
Copy link

It's in the root of my domain. I guess the title of this ticket isn't what I'm speaking to exactly, rather the specific problem mentioned. Reloading the page (or browsing directly to it) at a deep state in html5mode results in an empty state. Works fine in normal mode of course.

@nateabele
Copy link
Contributor

Again, I'm using this in production and it works fine. If you can show some example code that demonstrates the issue, I'd be happy to help you debug it.

@naturalethic
Copy link

I understand that it is fixed in 1.1.5. I'm using angular HEAD.

  $stateProvider
      .state 'app',
        abstract:     true
        template-url: 'app/app.html'
        controller:   'appController'
      .state 'app.home',
        url:          '/'
        template-url: 'app/home/home.html'
        controller:   'appHomeController'
      .state 'app.enrollment',
        abstract:     true
        url:          '/enrollment'
        template-url: 'app/enrollment/enrollment.html'
        controller:   'appEnrollmentController'
      .state 'app.enrollment.individual',
        abstract:     true
        url:          '/individual'
        template:     '<div ui-view></div>'

So, given this, I can safely $state.go('app.enrollment.individual'), but if I reload that page afterward (/enrollment/individual) I simply get my index page with no resolved ui-view.

@nateabele
Copy link
Contributor

And if you can show me running code, I'll do my best to help you debug it.

@nateabele
Copy link
Contributor

Sorry, I realize I did say 'example code' above, which wasn't very clear. It's pretty hard to tell what the problem is from the snippet you posted, since by all accounts, it should work. What I meant was, if you can show me a running example of a reproduction of the problem, I'll step through it and see if I can figure out where it's going wrong.

@laurelnaiad
Copy link

I'm wondering how you can "go" to an abstract state...

@nateabele
Copy link
Contributor

Wow, I didn't even notice that. Yeah, that shouldn't work at all.

@naturalethic
Copy link

Oops, I actually chopped that out of my actual app and changed some names, pretend it isn't abstract.

@laurelnaiad
Copy link

So you're running in root and there's some question as to what the current state of angular's "base" calculation is... did you try setting <base href="/"> in the head? It's helped others.

@laurelnaiad
Copy link

I also don't think coffeescript converts dasherized to camel case. template-url is therefore not valid. It seems to try to do subtraction when it sees that syntax: like here

Are you at all interested in posting a new copy of the code that you think should work?

@naturalethic
Copy link

I'm actually using LiveScript. That example code was just atrocious wasn't it?

Good news! <base href="/"> fixed it! Sorry for inciting such a confusing dialog.

@nateabele
Copy link
Contributor

No worries, glad you got it sorted.

@laurelnaiad
Copy link

And thanks for explaining the dasherized properties.

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

No branches or pull requests

6 participants