Skip to content
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

fix(swagger): add polyfill for swagger #678

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/app/api-docs/api-docs.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import {AfterViewInit, Component} from '@angular/core';
import SwaggerUI from 'swagger-ui';
import {TranslateService} from '@ngx-translate/core';

@Component({
selector: 'api-docs-page',
selector: 'app-api-docs-page',
templateUrl: './api-docs.component.html',
styleUrls: ['./api-docs.component.css']
})
export class ApiDocsComponent implements AfterViewInit {

constructor(public translateServier: TranslateService) {

}
constructor() {}

ngAfterViewInit() {
const ui = SwaggerUI({
Expand Down
6 changes: 6 additions & 0 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,9 @@ import 'zone.js'; // Included with Angular CLI.
* APPLICATION IMPORTS
*/
import 'event-source-polyfill/src/eventsource.min.js';

// For Swagger UI
(window as any).process = { browser: true };
(window as any).global = window;
// @ts-ignore
window.Buffer = window.Buffer || require('buffer').Buffer;