Skip to Content
Cloud Native Python
book

Cloud Native Python

by Manish Sethi
July 2017
Intermediate to advanced
374 pages
8h
English
Packt Publishing
Content preview from Cloud Native Python

Working with Observables and AJAX

In order to get the data from the RESTful API, we will use AJAX. Observables keep a track of the changes made on the data and reflect them, automatically, on all the locations where it is used and defined by ViewModel.

By using Observables, it becomes very easy to make the UI and ViewModel communicate dynamically.

Let's create a file named app.js, which has Observables declared, inside the static directory with the following code--if the directory does not exist, create it:

 function User(data) { this.id = ko.observable(data.id); this.name = ko.observable(data.name); this.username = ko.observable(data.username); this.email = ko.observable(data.email); this.password = ko.observable(data.password); } function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python for DevOps

Python for DevOps

Noah Gift, Kennedy Behrman, Alfredo Deza, Grig Gheorghiu
Cloud Native

Cloud Native

Boris Scholl, Trent Swanson, Peter Jausovec

Publisher Resources

ISBN: 9781787129313Supplemental Content