How to include an Angular 7 application in an existing html file and website?

后端 未结 1 988
抹茶落季
抹茶落季 2021-01-17 00:26

I have on one side an existing website, on the other I have an Angular 7 application component.

I\'d like to edit my existing someusecase.html and reuse

相关标签:
1条回答
  • 2021-01-17 00:38

    1) Run

    ng build
    

    2) got into the dist folder

    3) Copy & paste all of the files there, to your original app, except for the index.html file.

    4) Open the not-copied index.html file

    5) Copy all of the <script> tags in this file, into your someusecase.html file, at the same spot.

    6) use your app component selector wherever you want your angular application to be displayed.

    Note that this is only informational : in real life, this should be automated, because you would have to do this manipulation on every build.

    0 讨论(0)
提交回复
热议问题