Question

I've been using DurandalJs for an application I've developed where I have a core group of functionality (JS, Html files) saved in domain XXX. I have a client app (domain YYY) that uses the JS, Html files from domain XXX. I have DurandalJs set up to inject JavaScript viewModel (and associated view) from a different domain. It's working really well.

I'm learning AngularJs and am trying to figure out how to do the same. Is it possible to inject a JavaScript resource from a different domain using AngularJs?

Thanks for your help.

Was it helpful?

Solution

Durandal uses requirejs to load resources. Angular do not have a resource loader but you can also use require. You will need to set it up yourself.

http://requirejs.org/docs/whyamd.html

There is no restriction on loading resources from different domains. The only restriction on Cross origin request is when you are using ajax.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top