-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal style appending continuously in head tag when using CDN link in single page application on navigation. #1340
Comments
thanks for reporting this @Rahul-kalsha ! and all the detail it's really helpful! im unfamiliar with Angular but i know @amritk is quite the Angular wizard; i wonder if the |
Hello @marclave, there is a way to load the CDN API reference script only once during the initialization of the page. However, when navigating to different pages, the API documentation doesn't display in the browser. To address this issue, I've decided to load the script in the 'ngOnInit' function. This ensures that every time there's a navigation change, the component reloads, and the CDN API reference script is also called again. |
So we should make an angular integration that handles this. But for now in ngOninit instead of loading the js again, all you need to do is call the initialization method. Maybe @marclave knows it off the top of his head otherwise I can check when I get to a computer |
So I took a look and there is no method for init in |
Alright @Rahul-kalsha we have just added some events, you can use the reload one now as seen in the docs in the PR |
Still I am getting this issue with this CDN version : https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.21.2 |
What happens?
I integrated scalar API documentation via CDN link in angular SPA project. but there is a issue like Internal style appending continuously in head tag in single page application DOM on navigation change. Due to this it will impact on web performance and it's a bad structure of DOM.
Here i am adding the code. Help me to fix this bug.
Here is the component file:
Here is the html file:
You can check visually here and suggest me proper solution if i am miss any configuration then also please help me.
Internal.style.appending.continuously.in.head.tag.in.SPA.mp4
What did you expect to happen?
The internal style append should only happen once.
How can we reproduce the issue?
Swagger/OpenAPI Example
No response
The text was updated successfully, but these errors were encountered: