I am trying to develop an app and I think that my project has many folders of pages. This is the structure of my project:
private-pages/ --post (create and edit post) --post-view (viewing single post) --feed (viewing multiple posts) --group (create and edit group) --group-view (view single group) --group-list (viewing multiple groups) --profile (view profile) --profile-edit (edit profile) --tabs public-pages/ --login --register --forgot-password
I tried researching and have found and two ideas seems that seems to be promising. Ngif and components.
- Using ngif, I will try to merge pages such as post and post-view in one page depending on navParams which I am currently using in post(create and edit post). Something like
post/add post/edit/1 post/view/1
all this points to post module. Now my problem here is the code in post.page.html will be too long since there will be three ngif’s which leads me to the next idea.
- Using components, again using a single page, I will generate three components such as add, edit, and view posts and ngif them again. While this will shorten the code on post.page.html, I am not sure this is the most practical way. And where should I save the components? Should I create components folder or inside the post folder?
I have also read that components are shareable to different pages. Are components only limited to this and not to one-to-one scenario such as mine?
So going to back my main point, am I doing this correctly? Or is there a more practical way on doing this?