-
Notifications
You must be signed in to change notification settings - Fork 198
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
No .html file when creating a module #105
Comments
I have no idea what sense it would make to have a random html file created when you create a module. If you want a partial, create one in the module...? Why would you declare a ui-view in a module? Wouldn't that go in the main app (likely the index.html)? |
Maybe I wasn't concise enough, When you create your angular app, you will have your app module in app.js, and your index.html file. From the angular Module Documentation: 'Most applications have a main method that instantiates and wires together the different parts of the application.' I think that it should not only apply to .js files, just like index.html is linking other partials of the app module, then having a .html file in a module would link its own partials. For big applications, especially those needing ui-router, you will start breaking your application modules base on your main 'pages'. For example, if you visit mywebsite.com/admin, you would see your admin page, which is composed of multiple partials which are all connected together in admin.html. admin.html
In the current module configuration, we need to create a first partial to do the job of admin.html (admin-partial), then create all the other partials into admin-partial if we want to respect some kind of logical directory structure. Which in the end is not super elegant. Maybe it is only a personal choice, juste like the fact that I like having a main controller in a module (and I can simply add it inside app.js or my_module.js). I can of course just create by hand that .html file, I just thought it could make sense to have it directly in the generator. |
I find it pretty strange for a 'module' not to have it's own .html file.
You will obviously cut your module into multiple partials, but you still need to define the ui-view or ng-include for your partials. (What better place than the module .html?)
The text was updated successfully, but these errors were encountered: