Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:55:31+00:00 2026-05-31T09:55:31+00:00

I have a scenario where I’ve developed a widget based application , which injects

  • 0

I have a scenario where I’ve developed a widget based application, which injects itself into the DOM of a consuming application. That widget uses KnockoutJS to render it’s own UI, and it binds do it’s own ViewModel.

The consuming application (possibly not mine) also uses KnockoutJS to render it’s own UI with a totally different ViewModel.

What happens is that the consuming page loads and runs ko.applyBindings(hostPageViewModel). Then the widget loads and runs ko.applyBindings(widgetDataViewModel). Once the second applyBindings is executed, the consuming page looses the context of it’s bound model and displays nothing. In debug, I can see the data render on the consuming application, then get wiped by the widget application.

Other than trying to maintain two totally different instances of Knockout (not even sure if this is possible but I was thinking about newing the widget version and calling it kotwo), is there a solution for this?

I can not applyBindings only one time because of the application within an application style of this design.

I’d love some help with this one if anyone has suggestions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:55:32+00:00Added an answer on May 31, 2026 at 9:55 am

    I think you will need to scope your second apply bindings just to your widget containing div which is only added to the DOM after your widget loads and after your first applyBindings is called.

    So the widget would call

    ko.applyBindings(widgetViewModel, $widgetDiv);
    

    This will stop them treading on each others toes.

    As for having two versions of KO on the page, I’m not sure what the consequences are. Could you test for ko object and if not found include your files dynamically?

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario where I will be involved in windows application which is
I have a path defined: when /the admin home\s?page/ /admin/ I have scenario that
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
I have a scenario where users of my ASP.NET web application submit testimonials consisting
I have a scenario in a system which I've tried to simplify as best
Have a scenario where we un-intentionally merged a named branch ( ABC ) into
I have a scenario where I have one thread that loops between waiting and
I have a scenario that is causing a type mismatch that I cannot seem
I am developing a java application. I have scenario to take screen shot of
I have a scenario which is not easy to explain, but I am sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.