redoc/lib/components/ExternalDocs/external-docs.ts

19 lines
531 B
TypeScript
Raw Normal View History

2017-02-03 00:08:04 +03:00
'use strict';
import { Component, Input, ChangeDetectionStrategy, OnInit } from '@angular/core';
import { BaseComponent, SpecManager } from '../base';
@Component({
selector: 'redoc-externalDocs',
template: `<a *ngIf="docs" [href]="docs.url" [innerHtml]="docs.description | marked"></a>`,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ExternalDocs implements OnInit {
@Input() docs;
ngOnInit() {
if (this.docs && !this.docs.description) {
this.docs.description = 'External Docs';
}
}
}