Closed IEvangelist closed 7 years ago
In looking at this more closely, it might have something to do with me attempting to use the bundle *.umd.js
?
In fact, I just changed my systemjs.config.js
to use the non-bundled approach and it works. :cry:
Perhaps, the bundling is the issue.
JavaScript bundling/loader fatigue is real. I'll try working through the Quickstart and see if I can shake this loose.
@IEvangelist How I got it to work is to impour the min
of ng2-idle in my index.html.
Then for the map configuration I add ng2-idle like this: 'ng2-idle': 'node_modules/ng2-idle'
Finally in the packages configuration I add ng2-idle like this: 'ng2-idle': { main: 'index.js', defaultExtension: 'js' }
Using the alpha 18 I am getting "Cannot read property 'forRoot' of undefined(…)" on the Ng2IdleModule. I am trying to add ng2-idle to the quickstart project. I followed @patrickracicot but I get the error with or without including the min in my index.html.
I've refactored this module heavily. I've switched to providing a UMD bundle (as well as plain old ES5 source) in the package. That will hopefully sort this problem. Please refer to the README and CHANGELOG for more information.
In looking at the
systemjs.config.js
from the Quickstart, we see how to reference packages viamap
andpackages
from the SystemJS config API. For all of the scoped@angular
packages this works swimmingly. However, I cannot getng2-idle
orng2-idle-keepalive
to properly be referenced. What am I doing wrong?Here is my
wwwroot/js
folder hierarchy:Here is my
systemjs.config.js
:When the files are requested by the client module loader, they return happily but then references to any objects of these from
import
statements areundefined
?Keep in mind that I have tried all sorts of alternative ways of referencing these packages, including but not limited to
paths
, implicit versus explicitmain
reference inpackages
, implicit versus explicit.js
file inmap
, etc...