-
Notifications
You must be signed in to change notification settings - Fork 661
Is it possible to have multiple modules within a single generated project? #737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I have the same requirement. When app become bigger, I would like to extract some sub-modules, but I don't know how to do. |
@sinorga I still feel that we should be able to generate different compiled files per module.. but this is the solution I landed at to allow us to define separate modules although it is all compiled into one file. Define a module (
Then import it for use in my primary app (
I'm still new to this class based approach so this may not be 100%... but it's bridging the gap for now. |
@benjamincharity I am new to this field too, thanks for your sharing. I tried to modify the gulp task flow to build all modules, but I think yours is much simple and straightforward by using ES6 syntax. I would try it :D Build all modules into one files is suitable for me at this moment. |
Glad it's helpful. I like the separation of partitioned modules, but until we hear from someone with more knowledge (bump!) it is definitely getting us by! |
Thanks for sharing. Definitely needs to be a recipe of the generator |
Maybe the next sample app should contain a module 'layout' |
It seems that an extra line of |
The solution of @benjamincharity works for mw too. But as @hardywu mentioned if have to an extra line of code so the splash module is compiled
Otherwise the module is ignored by the compiler. Maybe there is an option in the compiler to compile all files and modules, even if they are not used. Anyway it would be generally great if the example app could cover this scenario. It makes a lot of sense to have a folder with angular modules which are more or less self containing. So one only have to add the module to the dependencies of the main angular app. We use this a lot to reuse modules between different projects. |
@4kochi Somehow, it works in one line without compiler configuration:
|
Thanks @hardywu, that works for me too. But I did not found out why yet. |
It works as |
While importing to Multiple modules should be handled by gulp. in You may have a different extension than @sinorga You mentioned modifying gulp code as well. What was your change? What didn't work? I haven't tested this modification thoroughly and I am not familiar with the code in I hope someone will pick up from here. |
I disagree @vucalur. I think that For instance, if you have 30 modules over 2 applications (admin + webapp), then you only want 2 artifacts from the build process, not 30 or 32. That is a bigger idealogical change on my part, where I would love to see other peoples' ways of doing it. @vucalur and myself clearly have different ideas, and I'm sure we will see a few other suggestions. |
[fixes #737] adds recipe for using multiple modules
It seems like this should be simple but I can't seem to get it working for the life of me.
I want to create a parent module (
app
) that includes other modules as dependencies (app.admin
,app.reporting
, etc). However, it seems that only files which are included in the top levelindex.module.js
are included in the served page.The error I get is the standard
not available
angular error:Looking into the generated files it is clear that only the top level
index.module
and it's required files are being loaded.Any ideas on this? Been using this generator for a while now with pleasure. Hope I can keep with it!
Info
Generator version:
0.12.1
.yo-rc
:The text was updated successfully, but these errors were encountered: