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

Relative child-routing #16

Closed
niwrA opened this issue Dec 21, 2016 · 7 comments
Closed

Relative child-routing #16

niwrA opened this issue Dec 21, 2016 · 7 comments

Comments

@niwrA
Copy link

niwrA commented Dec 21, 2016

The tutorial ends with suggesting that you can use .person instead of people.person for relative addressing. I could not get this to work however (it works otherwise). Is that a bug? Or am I just missing something?

@christopherthielen
Copy link
Member

christopherthielen commented Dec 21, 2016

I just checked the plunker and it actually does use relative links:

https://plnkr.co/edit/1wB5QZSPvvCJZXBWMLXU?p=preview

components/people.ts

          <li *ngFor="let person of people">
            <a uiSref=".person" [uiParams]="{ personId: person.id }">
              {{person.name}}
            </a>
          </li>

What troubles are you having?

@niwrA
Copy link
Author

niwrA commented Dec 23, 2016

I have to use people.person, or it simply won't work.

My biggest problem right now though, which may make me return to regular Angular 2 routing, is that the angular cli can't compile with the UIRouter.ForRoot() line in there. If I add it back after ng serve it runs fine. Also, when I enter a route in the address bar, it doesn't work. Only the routing through uiSref links works at the moment. Presumably I'm overlooking something.

@kolkov
Copy link

kolkov commented Dec 23, 2016

HI! Try this temporary solution for Angular cli #13

@mackelito
Copy link

@kolkov would you mind posting how you solved it? The repo posted in #13 is a 404 :(

@zurie
Copy link

zurie commented Dec 29, 2016

@niwrA you should try this in your UI Router Config

import {UIRouter} from "ui-router-ng2";
import {Injectable} from "@angular/core";

@Injectable()
export class MyRootUIRouterConfig {
  constructor(uiRouter: UIRouter) {
    //disable the trailing slash
    uiRouter.urlMatcherFactory.strictMode(false);
    //disable the case sensitivity
    uiRouter.urlMatcherFactory.caseInsensitive(true);

  }
}

@christopherthielen
Copy link
Member

christopherthielen commented Feb 11, 2017

There is now a nontrivial sample app built with the Angular-CLI.

@kolkov
Copy link

kolkov commented Feb 25, 2017

Thank You very much for your work, @christopherthielen!

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

5 participants