Angular 2 Base Href not applied -


i've built app using angular 2 rc 1. various environments deployed have different url base paths (locally localhost:12345/, on dev server may 192.168.1.1/myapp, on qa may 192.168.2.2/testapp, etc.). i'd use tag handle these differences, telling angular in root folder locally, in myapp folder dev, in testapp folder qa, , on.

however base tag seems ignored angular. setting successfully, , when view page source of app see expected. angular looks files in root folder, though, when base href set.

my tag looks this:

<head>   <base href="/myapp">        etc... 

it's first tag inside head. expectation angular should files in localhost:12345/myapp. uses localhost:12345/. understanding of tag wrong, or have error?

(as side note, i'm pretty sure can't set base url when angular bootstrapping because need pull .net web.config file. i'm doing via viewbag , can confirm populating correctly.)

aha, apparently needed be

<base href="/myapp/"> 

with slash on both sides!


Comments