L
L
LoveCode &Coffe2019-12-02 03:37:54
Video
LoveCode &Coffe, 2019-12-02 03:37:54

How to force the browser to take files from the right place?

I write spa. Made a router.
And with normal paths like /startGame, the browser loads files from here localhost :4200/img/src
But when the path is complex like /level/1, it tries to find files in localhost:4200/level/img/src
in the first case?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-12-02
@LoveCode &Coffe

You forgot to include a leading slash in resource addresses.
here is an explanation with examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question