dynamicsmobile
Version:
Allows development of off-line mobile and web business apps over the Dynamics Mobile platform. More info on https://www.dynamicsmobile.com
25 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInjectable = exports.Injectable = exports.INJECTABLE_METADATA_KEY = void 0;
require("reflect-metadata");
const dms_root_container_1 = require("./dms-root-container");
exports.INJECTABLE_METADATA_KEY = Symbol("INJECTABLE_KEY");
function Injectable(options) {
return function (target) {
Reflect.defineMetadata(exports.INJECTABLE_METADATA_KEY, true, target);
dms_root_container_1.RootDIContainer.addProvider({
provide: target,
useClass: target,
singleton: options ? options.singleton : undefined,
useFactory: options ? options.factory : undefined,
replace: options ? options.replace : false
});
return target;
};
}
exports.Injectable = Injectable;
function isInjectable(target) {
return Reflect.getMetadata(exports.INJECTABLE_METADATA_KEY, target) === true;
}
exports.isInjectable = isInjectable;
//# sourceMappingURL=injectable.js.map