define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_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.destroy = function () {
this.services = {};
};
return ServiceLocator;
}());
exports.ServiceLocator = ServiceLocator;
});
|