Using Angular CLI's 'new' and 'build' results in stuck on "Loading..." -


created new project ng new test , ran ng build --prod. pushed dist folder github repo , enabled pages. resulting page seems stuck on "loading....". recreated using express sendfile index.html in dist , again angular2 app stuck on "loading..."

ng serve seems working fine , localhost:4200 results in "app works!" displaying.

is known bug , if so, how else can project built production?

you need set base href while generating dist folder.

try this

ng build --prod --base-href . 

p.s : don't forget dot @ end.then push it.

for express serve dist folder, please follow following gist gist.github.com/parthghiya/eb337e2ee63ce8785d714e251b7ef0b8


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -