Closed jhancock1975 closed 8 years ago
Thanks for the report. I definitely know that the generator won't import the new module and add it to your main DI list, but I'm not sure how to go about doing something about that. If we automatically inject an import of every new module into the main app file, it sets people up for a not-so-optimized app (especially for lazy-loading). A lot of the time, you don't want your new module to be imported by the main app file. On the other hand, it might confuse people that they can't immediately use the route. I'm thinking the best thing to do might just be to add instructions after an Angular subgenerator is run about importing the new module and adding it to another module's DI list.
The 'ngInject';
part needs to be fixed for sure, though.
generator-ng-component 1.0.2 has been published to fix the 'ngInject'
issue
How about if you automatically inject an import of every new module into the main app file, but then comment it out by default. The user then has the option to uncomment it out.
@krokhale I don't think that's a very good idea. That has both the effects of not importing the new module immediately, so the route is automatically reflected, and always adding the data to the main app.js
, which can lead to bad practices.
thanks for solution
I am using generator-angular-fullstack version 4.0.1
% npm list -g --depth=0 | grep generator-angular-fullstack ├── generator-angular-fullstack@4.0.1
after running
angular-fullstack generates files properly under client/app/games, but browsing to http://localhost:3000/games only re-directs to the home page.
I have to add two things to client/app/app.js:
N.B: I had to add, "games," to the list of modules.
After that, when open the application in a browser (http://localhost:3000), I get a totally blank screen.
Looking at the browser (chrome) JavaScript console, I see
Copying off of the main module, I see I am missing this line
directly under the line
In client/app/games/routes.js After adding that, the site loads again, and I can browse to http://locahost:3000/games