Comments (2)
A few notes first.
I highly recommend always installing as a node module directly via npm install. It seemed as if you weren't and that could create folder hierarchy issues within the package itself if you copy them incorrectly.
Second, I'm by no means a SystemJS expert so I'm continuously learning more about the package manager myself. The demo is set up with what I knew would work but of course I'm happy to expand it to additional examples to support other situations.
The main differences between your setup with or without the map in comparison to my systemjs demo is that you have declared a package. Once you declare a package, you are essentially declaring another root path which is placing the mapped angular2-toaster node module outside of the expected path. You could fix this by moving up a directory for your module inclusion when mapping:
System.config({
defaultJSExtensions: true,
packages: {
app: {
format: "register",
defaultExtension: "js"
}
},
map: {
'angular2-toaster': '../node_modules/angular2-toaster'
}
});
System.import('app/main')
.then(null, console.error.bind(console));
In addition, note the defaultJSExtensions: true
option. My build/app points to the folder physically located at build/app.js. the default extension ensured it was properly loaded via the import statement. It may be that this is all you need to get it working since it looks like your request IS to the node_modules folder which leads me to think that your app/main.js file actually lives at the root level, not in the logical app
folder.
Finally, all of this assumes that when you include the module and build it (assuming you are using typescript although the relative pathing should be the same for es5/es6), you import your module via the full package declaration: angular2-toaster/angular2-toaster
.
from angular2-toaster.
Please see the new, additional demo that I added. The package needs to be mapped AND make sure that you are setting your tsconfig.json build option to system, not commonjs as I was in the original systemjs demo (which still shows how you can manually map commonjs builds via systemjs).
from angular2-toaster.
Related Issues (20)
- Extend peer dependencies to Angular 9 HOT 1
- Not woring on angular 8 ssr(server side rendering) HOT 1
- Angular 9 Angular Dependency Injection issue HOT 2
- Error with Angular 9 HOT 3
- Can't upgrade to Angular 10 HOT 6
- Extend peer dependencies to Angular 10 HOT 1
- Angular 10 - 'ModuleWithProviders<T>' requires 1 type argument(s) HOT 2
- How to add containerId in ToasterConfig? HOT 3
- Typing error in build for Angular 11 HOT 5
- Cannot target which container to show toast in HOT 1
- Duplicated Nested Close Buttons after update HOT 2
- Angular Universal SSR support request HOT 4
- Warning: Can't resolve all parameters for ToasterConfig HOT 2
- New release for Angular 13 ? HOT 7
- 'toaster-container' is not a known element
- Thoughts of renaming the css class by adding prefix e.g. ng2- HOT 1
- Angular 15 seems not suported HOT 1
- Not working in angular 16.0 HOT 1
- Angular v17 support
- Angular v14 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-toaster.