1) What is KnockoutJS?
It is a JavaScript library which is based on MVVM pattern that helps developers in building rich and responsive websites.
2) Who is the author of KnockoutJS?
Steve Sanderson is the author of KnockoutJS.
3) What are the features of KnockoutJS?
Features of KnockoutJS are:
Templating
Extensible
Dependency Tracking
Declarative Binding
Automatic UI Refres
4) What is the difference between KnockoutJS and MVC?
Difference between KnockoutJS and MVC are:
KnockoutJS |
MVC |
KnockoutJS is MVVM pattern |
MVC is design pattern |
Supports two types of binding |
Supports only one-way binding |
model part is not directly bind with the view page |
model part directly bind with the view page |
Here, the UI part is automatically updated |
Here, the UI part is not automatically updated |
5) What are the different ways of using templates in KnockoutJS?
Different ways of using templates in KnockoutJS are:
Native Templating
String-based Templating
6) How many types of data binding available in knockoutJS?
Types of data bindings available in KnockoutJS are:
CSS Binding
Text Binding
Attr Binding
Style Binding
Value Binding
Visible Binding
Template Binding
7) How to get row index in knockoutJS?
By using
$.index()
8) Which method is used to delete an item from a KnockoutJS Array?
By using
remove or removeAll method.
9) What is dependency tracking in KnockoutJS?
Dependency tracking: The KnockoutJS will automatically update the UI (DOM) when your data model is change.
10) What is MVVM?
MVVM stands for Model-View-ViewModel. MVVM is an architectural design pattern for developing applications. This design pattern is derived from MVC pattern.
11) What is observable in KnockoutJS?
observable: It is a property of knockoutJS that contain the view model. This property is bind with UI (View) in two-way binding.
12) What is Computed Observable?
Computed Observable: It is a function of knockoutJS which are depends on the other observable properties. The Computed function are automatically update when any changes on these dependencies.
13) What is template in KnockoutJS?
Template: It is a set of DOM elements which can be used repetitively.
Templating makes it easy to build complex applications.
14) What are the context properties used in KnockoutJS?
There are two context properties used in KnockoutJS are:
$index property
$parent property
15) What is $index and $parent property in KnockoutJS?
$index property: Returns the index of the current context item in the array.
$parent property: Allows us to examine the parent of an object.