k15t-aui-ng2
Version:
aui-ng2 is a set of angular 2 components, directives and services to simplify the integration with Atlassian products based on AUI/ADG. The library is still under development and is considered in an experimental state. So be aware that things will change
35 lines (27 loc) • 825 B
text/typescript
import {Injectable, Inject, Optional} from '@angular/core';
import {AuiNgRequestProperties} from './request-parameters';
import {BASE_URL} from '../common/constants';
()
export class AuiNgConnectService {
constructor(
() (BASE_URL) private baseUrl?: string
) {}
getAP() {
return window['AP'];
}
executeRequest(requestProperties: AuiNgRequestProperties): void {
this.getAP().require(['request'], request => request(requestProperties));
}
close() {
this.getAP().require('dialog', function (dialog) {
dialog.close({});
});
}
getBaseUrl(): string {
if (this.baseUrl !== undefined && this.baseUrl !== null) {
return this.baseUrl;
} else {
return '';
}
}
}