From a765925da0b836ea5ee74c6b4d24b97dc1a84557 Mon Sep 17 00:00:00 2001 From: Jacob Poul Richardt Date: Thu, 20 Nov 2014 16:35:35 +0100 Subject: [PATCH] Added case for registering a custom component with an empty config for custom elements, where loading is handled by name convention --- knockout/knockout.d.ts | 1 + knockout/tests/knockout-tests.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/knockout/knockout.d.ts b/knockout/knockout.d.ts index 3c2eaaca0..3ac8d0a0e 100644 --- a/knockout/knockout.d.ts +++ b/knockout/knockout.d.ts @@ -564,6 +564,7 @@ interface KnockoutComponents { register(componentName: string, config: KnockoutComponentRegisterFnViewModel): void; register(componentName: string, config: KnockoutComponentRegisterStringTemplateFnViewModel): void; register(componentName: string, config: KnockoutComponentRegisterAMD): void; + register(componentName: string, config: {}): void; isRegistered(componentName: string): boolean; unregister(componentName: string): void; diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 2b9253d5c..64a91d199 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -645,6 +645,7 @@ function test_Components() { // object template for element and inline function (commonly used in examples) ko.components.register("name", { template: { require: "module" }, viewModel: { instance: null } }); - // + // Empty config for registering custom elements that are handled by name convention + ko.components.register('name', { /* No config needed */ }); } } \ No newline at end of file