capital laravel meetup
capital laravel meetup
Knockout is a JavaScript framework that enables two-way data binding between UI elements and data.
{
firstName: "Daniel",
lastName: "Abernathy
}
capital laravel meetup
Model - View - ViewModel
{
"firstName" : "Daniel",
"lastName" : "Abernathy",
"age" : 25
}
capital laravel meetup
Model - View - ViewModel
<input type="text" class="first-name" data-bind="value: firstName" />
<input type="text" class="last-name" data-bind="value: lastName" />
<span class="full-name" data-bind="value: fullName"></span>
"Declarative Binding" with data attributes
capital laravel meetup
Model - View - ViewModel
function AppViewModel() {
this.firstName = "Daniel";
this.lastName = "Abernathy";
this.fullName = ko.computed(function() {
return this.firstName() + " " + this.lastName();
}, this);
}
capital laravel meetup
capital laravel meetup
capital laravel meetup
Similarities
Differences
capital laravel meetup