0

Again, I'm starting with one of the provided Angular 2 tutorial projects. Running it stock, I can navigate around using the programmed buttons and interactive controls.

OK, lets play with the URL bar. I can type in MYSITE:8000/crisis-center/heroes and sometimes see the Heroes component, which should be available only thru /heroes. Later the browser complains it can't find MYSITE:8000/crisis-center/app/main.ts. At this point the program has gone insane.

In Angular 2 can I expect the programmed components and URL bar to be equivalent? If I directly jump to something like http://localhost:8000/crisis-center;id=1;foo=foo/1 can I expect it to work? Or is there a config/programming trick?

Thanks, Jerome.

1 Answer 1

0

Make sure you have <base href="/"> somewhere in your index.html head.

If that's not the issue, then it may be related to your web server settings, for example if you are using local IIS to host your angular localhost:8000, you need to url rewrite rules on your web.config.

Sign up to request clarification or add additional context in comments.

1 Comment

It has the BASE tag. But I'm thinking it is the Web server. When I run things through plunker (angular.io/resources/live-examples/router/ts/eplnkr.html) and put it in its own window (Edit in Plunker editor, use separate window) I see the proper URL. My own example is run through npm and its "lite-server". After waiting for further comments, I'm willing to close the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.