redoc/lib/components/ApiInfo/api-info.ts

26 lines
710 B
TypeScript
Raw Normal View History

'use strict';
2016-06-22 21:17:48 +03:00
import { SpecManager, RedocComponent, BaseComponent } from '../base';
import { OptionsService, MenuService } from '../../services/index';
@RedocComponent({
selector: 'api-info',
styleUrls: ['./api-info.css'],
templateUrl: './api-info.html'
})
2016-05-06 00:48:41 +03:00
export class ApiInfo extends BaseComponent {
info: any;
specUrl: String;
constructor(specMgr:SpecManager, private optionsService:OptionsService, private menuServ: MenuService) {
super(specMgr);
}
2016-06-13 20:54:24 +03:00
init() {
this.info = this.componentSchema.info;
2016-05-06 12:46:41 +03:00
this.specUrl = this.optionsService.options.specUrl;
if (parseInt(this.info.version.substring(0, 1)) !== NaN) {
this.info.version = 'v' + this.info.version;
2016-07-01 18:09:42 +03:00
}
}
}