Comments (5)
I managed to get this going by setting the following in map in system.config.js (after the bits in the quick start)
'ng2-redux': 'node_modules/ng2-redux/lib',
'redux': 'node_modules/redux/dist/redux.min.js',
'lodash': 'node_modules/ng2-redux/node_modules/lodash/'
and in packages (after the bits in the quick start)
'ng2-redux': { main: 'index.js', defaultExtension: 'js' }
That bit about lodash looks a little suspect to me because it might be used in other packages and in all honesty the webpack approach looks a lot easier so I think I will go for that.
Thanks Seth for your help.
from store.
If I recall correctly the angular2 quickstart is based on SystemJS which means you need to do a little extra config over and above a simple npm install --save ng2-redux
.
Npm will install the files in node_modules
, but SystemJS isn't smart enough to look there automatically when it resolves imports. My recommendation is to find this portion of the quickstart's system.config.js
:
var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs'
};
and change it to
var map = {
'app': 'app', // 'dist',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'rxjs': 'node_modules/rxjs',
'ng2-redux': 'node_modules/ng2-redux'
};
Let me know if that doesn't work and I'll dig a little deeper (I mostly use webpack these days so my systemJS skills are a little weak :)
from store.
Hi Seth
Thanks very much for your suggestion - unfortunately it doesn't work although it does sound like that is the problem.
I've been using browserify and webpack for a while now and normally I would use webpack for preference because of the work I have been doing with react/redux.
I might be working on an Angular 2 project next so I thought I would start learning about it and I just picked up the stuff of the Angular 2 website because I thought that would be the simplest way to go. I also really like working with redux so ng2-redux sounds like a really good option.
When I found your solution didn't work I had a look on SystemJS and this does seem like something that lots of people have run into although I didn't really see a simple solution. So I guess it seems kind of odd to me for a great number of the Angular 2 examples and seeds to use SystemJS because it would seem to make things more difficult than they need to be - but I've only just started looking at it so what do i know :0)
Its unfair to ask, particularly as it doesn't seem to be an ng2-redux problem, but if you got any further suggestions I would very grateful.
Thanks very much
Chris
from store.
Great, glad it worked out.
from store.
For those trying to get this working with Angular Material 2, I took @talktough 's suggestion and:
First, modified the system-config.ts
:
const map: any = {
'@angular2-material': 'vendor/@angular2-material',
'ng2-redux': 'vendor/ng2-redux/lib',
'redux': 'vendor/redux/dist/redux.min.js',
};
Second, modified the angular-cli-build.js
:
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/**/*.+(js|js.map)',
'es6-shim/es6-shim.js',
'reflect-metadata/**/*.+(ts|js|js.map)',
'rxjs/**/*.+(js|js.map)',
'@angular/**/*.+(js|js.map)',
'@angular2-material/**/*',
'ng2-redux/lib/**/*',
'redux/dist/redux.min.js'
]
});
};
Third, manually installed redux via npm install redux --save
.
Fourth, just restarted the npm start
and she appeared to be good to go.
from store.
Related Issues (20)
- One More Time, Error: Actions must be plain objects. Use custom middleware for async actions
- Extend peer dependencies to Angular 7 HOT 2
- "NullInjectorError: No provider for NgZone" after upgrade to Angular 6 and angular-redux/store 9 HOT 2
- `window.devToolsExtension` is deprecated
- Storybook stories with @select HOT 2
- Metadata collected contains an error that will be reported at runtime: Lambda not supported.
- Request for articles/epics.md HOT 2
- Did you forget to configure your store? when running from a dist directory
- Select fires on unrelated store changes.
- Using @select decorator with @Input HOT 1
- Compiler Error when implementing Redux-Thunk Action
- @select decorator error: property has no initializer and is not definitely assigned in the constructor.
- Sharing common store between multiple modules ?
- Support for Angular 8? HOT 5
- installing angular-redux/store on angular 8.0.0 causes warning on missing peer dependencies (@angular/core@^7.0.0) HOT 2
- NgRedux<RootState> HOT 6
- Dispatch an action outside of ngZone HOT 1
- not understanding how to test subscription side effects HOT 1
- An unexpected error occurred: "https://registry.yarnpkg.com/@angular-redux%2fstore: read ETIMEDOUT" HOT 1
- Angular Version 12 is not supporting. HOT 1
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 store.