Is Knockout.js only for single page applications?

Is Knockout JS only suitable for building single-page web applications? I could not find examples where it was used in a multi-page web application (for example, could you create something like stackoverflow.com using Knockout?).

+4
source share
3 answers

This may seem like a broad question, but the answer can be quite short: No , Knockout.js is not just for single-page applications. Knockout.js is a template library that provides you with tools for creating dynamic views using the MVVM template.

There are no restrictions on whether you want to use knockout for a single-page application or a website with multiple pages. Please note that in the latter case, the knockout context will not be shared between pages.

+4
source

Well, this is a very broad question, but I myself am currently dealing with one portal, which is based on knockout.js. Well, not all - he has an MVC3 backend, which then exchanges data with another backend based on WCF services. So no, knockout.js is not the only technology :)

Nevertheless, data binding proves itself again and again as a convenient and useful approach to creating a data-oriented portal. There were problems in earlier versions of the knockout that did not support peek'ing models, etc. But now everything is in order.

Each of our capabilities can be said to be a one-page application, with its own model and elements. Although there are some common components for requesting a long survey, etc., which tend to change model values. Thus, we no longer need to base such weekly links as css classes to update information such as the number of operations. We rather update the model and let everything else take care of itself.

So, in short, yes: with the right combination of other good technologies, you can create large web pages with multiple pages.

+2
source

You can use Knockout for any type of application you want. I used it in MVC projects without problems, and they were not the only single page application template. I know that Microsoft has included Knockout with a project template with single-page applications by default, but you can also use it elsewhere without problems.

0
source

All Articles