Knockout.js components. What they are and what they are not
07 February 2015What are components? Some time ago, Knockout.js team released a new feature — components. This feature allows developers to build some custom components that will have their own view and logic. Registration of components looks almost like binding registration. ko.components.register('mywidget', { viewModel: function(params) { //Define view model here this.title = ko.observable("Hello from component!!!"); }, template: '<div data-bind="text: title"></div>' }); The example below looks very similar to the definition of user control in technologies like WPF/Silverlight or even WinForms. We have…