define(["require", "exports", "@syncfusion/ej2-base", "../renderer/responsive-dialog-renderer"], function (require, exports, ej2_base_1, responsive_dialog_renderer_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ServiceLocator = (function () {
function ServiceLocator() {
this.services = {};
}
ServiceLocator.prototype.register = function (name, type) {
if (ej2_base_1.isNullOrUndefined(this.services["" + name])) {
this.services["" + name] = type;
}
};
ServiceLocator.prototype.getService = function (name) {
if (ej2_base_1.isNullOrUndefined(this.services["" + name])) {
throw "The service " + name + " is not registered";
}
return this.services["" + name];
};
ServiceLocator.prototype.registerAdaptiveService = function (type, isAdaptiveUI, action) {
if (isAdaptiveUI) {
type.responsiveDialogRenderer = new responsive_dialog_renderer_1.ResponsiveDialogRenderer(type.parent, type.serviceLocator);
type.responsiveDialogRenderer.action = action;
}
else {
if (type.responsiveDialogRenderer) {
type.responsiveDialogRenderer.removeEventListener();
type.responsiveDialogRenderer = undefined;
}
}
};
return ServiceLocator;
}());
exports.ServiceLocator = ServiceLocator;
});
|