Adding Swagger UI to Angular App

后端 未结 2 880
小蘑菇
小蘑菇 2021-01-12 05:50

Is there a good way to add the Swagger UI to an Angular app without getting too much in the weeds?

I\'d like to add a reference to an API which is hosted on a differ

2条回答
  •  伪装坚强ぢ
    2021-01-12 06:48

    This is 8 months old now so I'm assuming you figured it out or moved on, but it's possible to do this in a basic, if not ideal, way using Renderer2. You'd basically create a script element containing the config for swagger-ui and a link to the external doc, then use Renderer2 to append the tag to your component. I'm using this now as a way to embed the swagger-ui in an angular app that allows the user to choose between different api docs.

提交回复
热议问题