I'm new to Aurelia, so I'm not really sure how this should work. I created a new Aurelia project and also installed bootstrap
simply by doing jspm install bootstrap
. I saw in console that this also pulled in jquery 3.0.0
.
Now my question is, how do I use bootstrap.css
, bootstrap.js
and jquery.js
in my project?
First attempt:
In app.html
I tried to do thhe following:
<require from="bootstrap"></require>
I tried that because I have the following line in my config.js
:
map: {
...
"bootstrap": "github:twbs/bootstrap@3.3.6",
...
}
This sort of works in the sense that it loads bootstrap.js
, but then gives an error in browser that it's missing jquery.js
. So it's not automatically loading jquery for me. Is this normal?
Second attempt:
I changed my require
to this in app.html
:
<require from="jquery/dist/jquery.js"></require>
<require from="bootstrap/css/bootstrap.css"></require>
<require from="bootstrap/js/bootstrap.js"></require>
I'm not sure how it knows where to look for the bootstrap.js
and bootstrap.css
file, since they are located in: jspm_packages/github/twbs/bootstrap@3.3.6/css/bootstrap.css
etc. But it knows how to find the bootstrap files. But not the jquery file.
I have this in my config.js
for jquery:
map: {
...
"github:twbs/bootstrap@3.3.6": {
"jquery": "npm:jquery@3.0.0"
},
....
}
So basically my question is, how should this work? Should require
autoload all the necessary files when I <require from="bootstrap">
. Or should I still load them as individual files? If so, how do I then load jquery in this case?