Added case for registering a custom component with an empty config for custom elements, where loading is handled by name convention

This commit is contained in:
Jacob Poul Richardt
2014-11-20 16:35:35 +01:00
parent 55443bc73d
commit a765925da0
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -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;
+2 -1
View File
@@ -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 */ });
}
}