Describe ViewModel in Knockout Js?

devquora
devquora

Posted On: Feb 22, 2018

 

A viewModel in Knockout js is a basic class that is created as JavaScript Function.It is declared as a variable that have member variables and methods.


var myViewModel = {
		personName: 'Bob',
		personAge: function(age){
		 return  age+"years old";
		 }
	};

    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..