-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RequireJS support - no exports? #3
Comments
additional info: Even the unit tests aren't using require to grab ko.plus stuff From the ko.command tests .html file:
the test code should be able to do a
or something like that |
To be honest I've only ever used it with knockout so have only needed to populate the Which elements are you trying to use without knockout? |
I'm not trying to use it without Knockout, I'm trying to use it without Knockout being GLOBAL. The way it is now, "command" does not get added to the "ko" that's retrieved by other modules with require('knockout') |
Ah yes, I've seen similar problems on |
That would be cool. For now, I have to rip apart the files to use the command object |
Or just grab the original source for ko.command on its own from https://github.com/stevegreatrex/ko.plus/blob/master/src/ko.command.js |
Either way, I have to custom modify the code to wrap it up into a module :-( |
Oh, and ko.command.js has a dependency on ko.loadingWhen.js too |
Hi I've hacked up a version that works with Durandal.js It's not tested but seems to work for me. |
Thanks a lot @kingsleyh for hacking a version of ko.plus. I have been banging my head against a wall trying to make ko.plus work with require.js without luck. |
Another thing those in this group could try is depart from the strict RequiresJS pattern, and allow a few globals. In my case, I include several scripts (mostly the ones that don't play well with RequiresJS) before Require is included on the page. From there, just add a few shims in your main config file like the below and your app will happily work as if these globals were modules.
|
Reviving this as it should really be fixed! The current version returns the The other option would be to return an object with the Thoughts? Suggestions |
It seems that the RequireJS support that's currently in the code supports retrieving knockout's "ko" variable through requireJS, but it doesn't seem to export its own variable.
(basically, it only adds things to the "ko" variable, it doesn't export anything)
So, I am unaware how to use this in a Durandal app I'm writing.
Can you tell me how to handle this?
The text was updated successfully, but these errors were encountered: