Does KnockoutJS provide suitable architecture for building large web apps ?

Does KnockoutJS provide suitable architecture for building large web apps ?

Asked on November 23, 2018 in knockout js.
Add Comment


  • 3 Answer(s)

    Use partial views and share observables between them.

    var some_observable = ko.observable()
    var Model1 = function(something)
    {
      this.something_1 = something;
    };
    var Model2 = function(something)
    {
      this.something_2 = something;
    };
    var view_1 = Model1(some_observable);
    var view_2 = Model2(some_observable);
    ko.applyBindings(view_1, document.getElementById('some-id'));
    ko.applyBindings(view_2, document.getElementById('some-other-id'));
    <div id='some-id'>
      <input data-bind='value: something_1' />
    </div>
    <div id='some-other-id'>
      <input data-bind='value: something_2' />
    </div>
    

          Try this model to handle a list of photos in a gallery application, where one view provide thumbnails and another view handle the  uploads.

    Answered on November 23, 2018.
    Add Comment

       Use the  partial views  with their own knockout task and  with their own view model.

       It works good – a rough page broken apart into many  independent partials. Most of the partial views have their own module/controller/endpoint so the modules are ‘skinny’ too.

       It’s a bad that  jQuery templates being dropped, but that’s a different issue.

       No server side contents, so no way to break up the page.But, lots of view models is the way to go.

    Answered on November 23, 2018.
    Add Comment

    Use the  KO and share  the View Models to the scope of functional module.

    Use the  TIBCO Page bus (Pub/Sub) for communicating between these functional modules in the page to keep the functional modules in a page decoupled and manageable manner.

    Answered on November 23, 2018.
    Add Comment


  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.