Book Image

Knockout.JS Essentials

Book Image

Knockout.JS Essentials

Overview of this book

Table of Contents (16 chapters)
KnockoutJS Essentials
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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.