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

31 lines
849 B
TypeScript
Raw Normal View History

'use strict';
2016-08-28 21:46:10 +03:00
import { Component, ChangeDetectionStrategy, OnInit } from '@angular/core';
2016-08-22 12:12:13 +03:00
import { SpecManager, BaseComponent } from '../base';
import { OptionsService, MenuService } from '../../services/index';
2016-08-22 12:12:13 +03:00
@Component({
selector: 'api-info',
styleUrls: ['./api-info.css'],
2016-08-22 12:12:13 +03:00
templateUrl: './api-info.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
2016-08-28 21:46:10 +03:00
export class ApiInfo extends BaseComponent implements OnInit {
info: any = {};
specUrl: String;
2016-10-31 11:15:04 +03:00
constructor(specMgr: SpecManager, private optionsService: OptionsService) {
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;
2016-08-30 20:16:06 +03:00
if (!isNaN(parseInt(this.info.version.substring(0, 1)))) {
this.info.version = 'v' + this.info.version;
2016-07-01 18:09:42 +03:00
}
}
2016-08-28 21:46:10 +03:00
ngOnInit() {
this.preinit();
}
}