Knockout REST API provides a simple and flexibe API to use REST services with Knockout ViewModel objects.
This code above, creates a view model called CityViewModel with 3 properties:
- service: it's a reference of our REST service, that point out to /api/cities;
- model: it's a observable reference to an POJO object;
- collection: it's a reference to model collection of cities;
At the end we applying this view model object into the page, using ko.applyBindings function. So simple, ha?!
Your new post is loading...