Reputation: 3658
I want to include AFRAME into my Rails application. So I downloaded the minified version of aframe and in my Asset Pipe I wrote \\= require aframe.min.js
When I try to access my AFRAME
object, I get an error that is linked to me missing the ThreeJS files associated with A-Frame.
Is there a way to load the A-Frame js file from the cdn's url instead of from my local server?
Upvotes: 3
Views: 165
Reputation: 3658
I found a work around. Here it is:
var l=d.createElement('script');
l.setAttribute('src', "https://cdnjs.cloudflare.com/ajax/libs/aframe/0.3.2/aframe.min.js");
h.appendChild(l);
And to access AFRAME
I call window.AFRAME
Upvotes: 2