Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

AMD Support #5

Closed
engyii opened this issue Mar 29, 2013 · 7 comments
Closed

AMD Support #5

engyii opened this issue Mar 29, 2013 · 7 comments

Comments

@engyii
Copy link

engyii commented Mar 29, 2013

I use knockout in an AMD context with require.js. The extension reports me that "knockout.js is not used in the page (ko is undefined)(...)" (which is true!).

Is there a way to make it works anyway ?

@timstuyckens
Copy link
Owner

I'll look into it.
I think it might be possible but their will have to be made conventions about your module name
Like:
require( "knockout")
require("ko")

@luv2code
Copy link

I also have this case. I personally use and most projects I've seen use require("knockout") or define(["knockout"], function (ko) { });

@luv2code
Copy link

I think something like this would satisfy 95% of the amd use cases:
https://gist.github.com/luv2code/5274902

@timstuyckens
Copy link
Owner

Just uploaded a new version of the plugin https://chrome.google.com/webstore/detail/knockoutjs-context-debugg/oddcpmchholgcjgjdnfjmildmlielhof/details?hl=nl&gl=BE
Thanks for the feedback!

@Munter
Copy link

Munter commented Apr 2, 2013

I was just wondering. Is there a reason why this extension needs to tap into the knockout library supplied by the user instead of packing its own?

@timstuyckens
Copy link
Owner

@Munter The "core" part of the extension runs in the context of the page of the user. When you run in that context you get acces to the current selected node ($0). In that context, knockout is already present.
Version conflicts are also avoided this way.

@engyii
Copy link
Author

engyii commented Apr 3, 2013

it's now working. thanks. this extension is super useful!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants