Hey everyone thanks for your time reading and helping !
I’m learning Ionic / Angular and I read a lot of doc and tutorials but there is still things I can’t figure out :
In Angular there are components and modules.
In Ionic there are components and pages (just a component from what I read) and modules.
Components structure are :
- mycomp.component.html -> the HTML template
- mycomp.component.scss -> the styling file
- mycomp.component.spec.ts -> unknown but told it’s not important (testing and stuff ?)
- mycomp.component.ts -> main logic
Modules strucutre are :
- mymodule.module.spec.ts -> same unknown file
- mymodule.module.ts -> module logic
A strange thing is when I create a page from ionic CLI it should then create a component but when creating a page I end up with a mypage.module.ts file so are pages components or modules ?
Why is there this extra file if pages are supposed to be components ?
If I want to dev a simple tab app with three tabs agenda / contact / actu should the structure looks like this ? (sorry if it’s stupid):
Where home is a page displaying my tabs (it’s created at the start so I don’t realy know but I supposed it’s a page) and inside three components Actu Agenda and Contact on which I will route so they’re displayed at the right time. Is this correct ?
I’m maybe wrong maybe xxxx.module.ts files are different stuff from what is call module which are @NgModule declaration even in xxxxx.component.ts files, so component could also be modules ? I’m lost in all this terminology haha
It was simple at the begining but I got into trouble when I tried to implement the routing for my tabs app.
The only question that matter is “What should the structure of a tabbed app looks like ?”, should I use something like :
- module
-
- page -> displaying the tabs
-
-
- component -> tab 1
-
-
-
- component -> tab 2
-
-
-
- component -> tab 3
-
or :
- module
-
- page -> displaying tabs
-
-
- page -> tab 1
-
-
-
-
- component -> tab 1 components
-
-
-
-
- page -> tab 2
-
-
-
-
- component -> tab 2 components
-
-
-
-
- page -> tab 3
-
-
-
-
- component -> tab 3 components
-
-
Or maybe something else, I think I’m just realy confused about those terms