简体   繁体   中英

Deployed angular application on Github pages doesn't show the application components

I tried to deploy my static app project on Github pages, I ran the command (ngh --dir dist/project-name)
and it generated a dist folder with an index.html file in it.

The problem is when I serve my angular project, the page loads all the components perfectly. but when I go to the github link of the project. it display the only content found in dist/index.html.

Do you know how to make it read the components inside the <app-root> component?
Thanks in advance

The ng serve result The empty github website link

The dist/index.html

if I added an in dist/index.html it will be displayed normally

I haven't worked with Github pages for some time, but the problems seems to be with the base link

I just checked my repo and this is what I have as the base link:

<base href="/">

Can you please try this?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM