I have an Aurelia app and in app.js I want to use jQuery.
So my config.js looks like:
System.config({
...
map: {
...
"jquery": "npm:[email protected]",
...
}
}
And in app.js I import the jQuery like this:
var $ = require('jquery');
But when I require it, I get the blank site. Same it was with import:
import $ from 'jquery';
What is wrong?
Thanks
EDIT: ok, solved. The problem is, the jQuery code must be called inside the attached() mehtod. So like this:
export class Class1 {
attached() {
//jQuery code here
}
}