Book Image

KnockoutJS Essentials

By : Jorge Ferrando, Jorge F Ferrando
Book Image

KnockoutJS Essentials

By: Jorge Ferrando, Jorge F Ferrando

Overview of this book

Table of Contents (16 chapters)
KnockoutJS Essentials
About the Author
About the Reviewers

Separation of concerns – behavior and data

We have found a problem in our application. When we use the ko.toJS function, the result is not as expected. This is a common scenario in software development.

We have made a bad choice setting some logic in our models and we need to fix it. To solve this problem, we are going to separate the data and these behaviors. We are going to use some classes that we will call services.

Services will manage the logic of our models. This means that each model will have a related service that will manage its state.