redoc/lib/components/ApiLogo/api-logo.ts

24 lines
540 B
TypeScript
Raw Normal View History

'use strict';
import {RedocComponent, BaseComponent, SchemaManager} from '../base';
@RedocComponent({
selector: 'api-logo',
styleUrls: ['./api-logo.css'],
templateUrl: './api-logo.html'
})
2016-05-06 00:48:41 +03:00
export class ApiLogo extends BaseComponent {
data:any = {};
2016-06-13 20:54:24 +03:00
constructor(schemaMgr:SchemaManager) {
super(schemaMgr);
}
prepareModel() {
let logoInfo = this.componentSchema.info['x-logo'];
if (!logoInfo) return;
this.data.imgUrl = logoInfo.url;
this.data.bgColor = logoInfo.backgroundColor || 'transparent';
}
}