knockout.js - KnockoutJS data-binding use instanceof on RequireJS modules -


I am creating a set of requiredJS AMD module objects.

I define my module:

  define (["Libs / Knockout",], function (to) {MyModuleClass = function () Content *}} MyModuleClass;};);  

In my view (HTML), I have data binding:

   

The goal is to show markup when samples are an example of MyModuleClass Otherwise, I do not want to show that markup

This problem occurs because: Because of me ViewModel is using RequireJS to load MyModuleClass as a scope variable in my ViewModel, There is no reference to MyModuleClass in Knock OutJS bond. This may fail in data-bound because the MyModuleClass is undefined within that radius. MyModuleClass also has other modules that get from it, so the call of the example is quite important as it still wants to get hair stuff from MyModuleClass to pass the data-band.

Are there any recommendations for solving this problem? I can create computable variables which I can turn off. Observations of those calculations can use an example logic, which will remove dependence from data-bound tags. This is my best idea that I have done so far - but I am not sure as much as it is, I will love it.

Any clean way to achieve similar functionality which is completely within the data - the bind tag will be my target

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

c# - NewtonSoft JArray - how to select multiple elements with LINQ -

javascript - amcharts makechart not working -