What is an observable in KnockoutJS?

devquora
devquora

Posted On: Feb 22, 2018

 

Observables: In KnockoutJS observables are special type of JavaScript objects that can notify subscribers about changes, and can automatically detect dependencies. Observables helps KnockoutJS to update your UI automatically when the view model changes.

Creating an Observable in KnockoutJS

var myViewModel = {
    personName: ko.observable('Bob'),
    personAge: ko.observable(123)
};

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Knockout js Interview Questions

    What is Knockout JS?

    Knockout JS is a JavaScript library based on MVVM (Model View ViewModel) pattern that helps you to create rich, respons..

    Knockout js Interview Questions

    What is the features of Knockout JS?

    Key Features of Knockout JS Dependency Tracking Declarative Binding Automatic UI Refresh Template Binding Written in Pu..

    Knockout js Interview Questions

    Types of data binding supported by Knockout JS?

    Knockout js supported two types of binding One-way binding Two-way bindingRead Best 30 React js Interview questions..