How to use the @aurelia/kernel.Registration function in @aurelia/kernel

To help you get started, we’ve selected a few @aurelia/kernel examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aurelia / aurelia / packages / testing / dist / umd / test-builder.js View on Github external
function createObserverLocator(containerOrLifecycle) {
        let container;
        if (containerOrLifecycle === undefined || !('get' in containerOrLifecycle)) {
            container = kernel_1.DI.createContainer();
            container.register(runtime_1.ILifecycleRegistration);
        }
        else {
            container = containerOrLifecycle;
        }
        const dummyLocator = {
            handles() {
                return false;
            }
        };
        kernel_1.Registration.instance(runtime_1.IDirtyChecker, null).register(container);
        kernel_1.Registration.instance(runtime_1.ITargetObserverLocator, dummyLocator).register(container);
        kernel_1.Registration.instance(runtime_1.ITargetAccessorLocator, dummyLocator).register(container);
        container.register(runtime_1.IObserverLocatorRegistration);
        return container.get(runtime_1.IObserverLocator);
    }
    exports.createObserverLocator = createObserverLocator;
github aurelia / aurelia / packages / testing / dist / umd / tracing.js View on Github external
static register(container) {
            container.register(kernel_1.Registration.singleton(this, this));
        }
        addCall(instance, method, ...args) {
github aurelia / aurelia / packages / testing / dist / umd / au-dom.js View on Github external
register(container) {
            container.register(runtime_1.RuntimeConfiguration, AuTextRenderer, kernel_1.Registration.singleton(runtime_1.IDOM, AuDOM), kernel_1.Registration.singleton(runtime_1.IDOMInitializer, AuDOMInitializer), kernel_1.Registration.singleton(runtime_1.IProjectorLocator, AuProjectorLocator), kernel_1.Registration.singleton(runtime_1.ITargetAccessorLocator, AuObserverLocator), kernel_1.Registration.singleton(runtime_1.ITargetObserverLocator, AuObserverLocator), kernel_1.Registration.instance(runtime_1.ITemplateCompiler, {}));
        },
        createContainer() {
github aurelia / aurelia / packages / testing / dist / umd / html-test-context.js View on Github external
get container() {
            if (this._container === void 0) {
                this._container = kernel_1.DI.createContainer(this.config);
                kernel_1.Registration.instance(runtime_1.IDOM, this.dom).register(this._container);
                kernel_1.Registration.instance(HTMLTestContext, this).register(this._container);
                this._container.register(this.Scheduler);
                this._container.register(debug_1.DebugConfiguration);
            }
            return this._container;
        }
        get scheduler() {
github aurelia / aurelia / packages / jit / dist / umd / binding-command.js View on Github external
register(container) {
            const { Type, key, aliases } = this;
            kernel_1.Registration.singleton(key, Type).register(container);
            kernel_1.Registration.alias(key, Type).register(container);
            runtime_1.registerAliases(aliases, exports.BindingCommand, key, container);
        }
    }
github aurelia / aurelia / packages / jit / dist / umd / binding-command.js View on Github external
register(container) {
            const { Type, key, aliases } = this;
            kernel_1.Registration.singleton(key, Type).register(container);
            kernel_1.Registration.alias(key, Type).register(container);
            runtime_1.registerAliases(aliases, exports.BindingCommand, key, container);
        }
    }
github aurelia / aurelia / packages / runtime / dist / umd / lifecycle-task.js View on Github external
register(container) {
            return this._container = container.register(kernel_1.Registration.instance(exports.IStartTask, this));
        }
        resolveTask() {
github aurelia / aurelia / packages / runtime-html-jsdom / dist / umd / index.js View on Github external
static register(container) {
            return kernel_1.Registration.singleton(runtime_1.IDOMInitializer, this).register(container);
        }
        initialize(config) {
github aurelia / aurelia / packages / runtime / dist / umd / observation / observer-locator.js View on Github external
static register(container) {
            return kernel_1.Registration.singleton(exports.IObserverLocator, this).register(container);
        }
        getObserver(flags, obj, propertyName) {
github aurelia / aurelia / packages / i18n / dist / umd / configuration.js View on Github external
register(container) {
                return container.register(kernel_1.Registration.callback(i18n_configuration_options_1.I18nInitOptions, () => options.initOptions), runtime_1.StartTask.with(i18n_1.I18N).beforeBind().call(i18n => i18n.task), kernel_1.Registration.singleton(i18next_wrapper_1.I18nWrapper, i18next_wrapper_1.I18nextWrapper), kernel_1.Registration.singleton(i18n_1.I18N, i18n_1.I18nService), ...renderers, ...translation);
            }
        };