-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support for Angular 6 #669
Comments
What do you mean by "does not work"? |
I have used ReDoc 1.x with angular 6 using the description in the following issue link WARNING in ./node_modules/dropkickjs/build/js/dropkick.min.js ERROR in ./node_modules/redoc/node_modules/json-schema-ref-parser/lib/resolvers/http.js I have also used the ReDoc version 2.0 with Angular 6 and I'm getting the following error. ERROR in ./node_modules/redoc/node_modules/json-schema-ref-parser/lib/resolvers/http.js |
I had a couple of dependency issues, like react, react-dom, rxjs-compat, styled-components. Even after resolving them I could not get build success. |
ReDoc 1.x is frozen now. Only critical bug fixes are done. ReDoc has been rewritten to React in versions 2.x so we don't have resources to investigate Angular issues of the 1.x version. Although if you can find the issue root and open a PR against |
Closing it as stale. |
I have upgrade v1.x branch to work on angular 6. When I run the project it runs ok. How can I make angular library out of this? |
I was able to get a workaround that solves this. You have to include the CDN script tag in your index.html, then import {
Component,
AfterViewInit,
ElementRef,
OnDestroy,
ViewEncapsulation
} from '@angular/core'
declare let Redoc: any
@Component({
selector: 'api-documentation',
templateUrl: './api-documentation.component.html',
styleUrls: ['./api-documentation.component.scss'],
encapsulation: ViewEncapsulation.None
})
export class ApiDocumentationComponent implements AfterViewInit, OnDestroy {
constructor(private element: ElementRef) {}
ngAfterViewInit() {
this.attachDocumentationComponent()
}
async getSwaggerSpec(): Promise<any> {
// swagger spec retrieval logic
}
async attachDocumentationComponent() {
const swaggerSpec = JSON.parse(await this.getSwaggerSpec())
const elem = this.element.nativeElement.querySelector('.documentation-root')
Redoc.init(swaggerSpec, {}, elem)
}
ngOnDestroy(): void {
this.element.nativeElement.querySelector('.documentation-root').remove()
}
} |
The Redoc 1.x and 2.0 does not work in Angular 6 version. When will the support for Angular 6 be available?
The text was updated successfully, but these errors were encountered: