How should I configure the base href for Angular 2 when using Electron?

后端 未结 2 797
谎友^
谎友^ 2021-02-18 16:26

I need to either set in the HTML or APP_BASE_HREF during the bootstrap for Angular 2 to not throw exceptions. If I set either of these the

相关标签:
2条回答
  • 2021-02-18 17:04

    Since the href attribute can take a relative path and thanks to @DavidC and @ChristianRondeau in the comments on the question for verifying, it should work like this:

    <base href="./">
    
    0 讨论(0)
  • 2021-02-18 17:13

    In a clean way, You can ONLY customize your build command without editing the value of <base href="/"> inside your index.html page

    ng build --prod --base-href=./
    
    0 讨论(0)
提交回复
热议问题