{"id":21836042,"url":"https://github.com/servrox/demo-ionic-tab-routing","last_synced_at":"2025-04-14T09:32:17.615Z","repository":{"id":121897845,"uuid":"171143116","full_name":"servrox/demo-ionic-tab-routing","owner":"servrox","description":"An Ionic project which shows different kinds of route definition for a tab based layout.","archived":false,"fork":false,"pushed_at":"2019-02-25T00:33:11.000Z","size":119,"stargazers_count":35,"open_issues_count":2,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T22:51:08.588Z","etag":null,"topics":["ionic4","lazy-loading","navigation","routing"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/servrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-17T16:15:59.000Z","updated_at":"2023-07-15T14:20:24.000Z","dependencies_parsed_at":"2023-07-12T06:01:41.958Z","dependency_job_id":null,"html_url":"https://github.com/servrox/demo-ionic-tab-routing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servrox%2Fdemo-ionic-tab-routing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servrox%2Fdemo-ionic-tab-routing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servrox%2Fdemo-ionic-tab-routing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servrox%2Fdemo-ionic-tab-routing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/servrox","download_url":"https://codeload.github.com/servrox/demo-ionic-tab-routing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248854225,"owners_count":21172317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ionic4","lazy-loading","navigation","routing"],"created_at":"2024-11-27T20:33:37.686Z","updated_at":"2025-04-14T09:32:17.593Z","avatar_url":"https://github.com/servrox.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Demo: Ionic project with a tab based layout \u003cbr /\u003e which shows different kinds of route definitions \u003cbr /\u003e for lazy modules\n\n![Live Demo](http://g.recordit.co/iTEmjAK5f9.gif)\n\n## Explanation\n\nThe example includes **two kinds of route definition**,\u003cbr /\u003e\nwhich are shown in *Tab One* and *Tab Two*.\u003cbr /\u003e\nYou can also see how to **dynamically adjust the routing** to use pages in different tabs.\u003cbr /\u003e\n\u003cbr /\u003e\nThe normal page flow for each tab is *Tab -\u003e Profile -\u003e Profile Settings*.\u003cbr /\u003e\nThe module flow is following: *App -\u003e Tabs -\u003e Tab -\u003e Profile -\u003e ProfileSettings*.\u003cbr /\u003e\nEach page is a lazy loaded module.\u003cbr /\u003e\nFor the navigation to the previous page I used the *ion-back-button*.\u003cbr /\u003e\nEach tab is stateful, which means that displayed pages are kept at a tab change.\u003cbr /\u003e\n\u003cbr /\u003e\nBecause the profile page can be called by tab one and tab two,\u003cbr /\u003e\nthere is some logic to make back and forth navigation work correctly.\n\n### Route definition for Tab One\n\nFor *Tab One* the whole page flow is defined in one file (s. *tabs.router.module.ts*).\u003cbr /\u003e\nIt is also possible to move the whole routing in *app-routing.module.ts*.\n\n### Route definition for Tab Two\n\nFor *Tab Two* there's only one one route definiton in *tabs.router.module.ts*:\u003cbr /\u003e\n*TabsModule -\u003e Tab2PageModule*.\u003cbr /\u003e\nEvery further route is defined in the then loaded module,\u003cbr /\u003e\nfor this demo it means that the modules loaded behind *Tab Two* defining two routes.\u003cbr /\u003e\n\u003cbr /\u003e\nFirst a *no-name-route* which loads the corresponding component.\u003cbr /\u003e\n(For the *ProfilePageModule* that means the *ProfilePage*.)\u003cbr /\u003e\nSecond the page-module we can route to.\u003cbr /\u003e\n(For the *ProfilePageModule* that means the *ProfileSettingsPageModule*.)\n\n## Important tip\n\nWith Ionic [4.0.0-beta.18](https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#400-beta18-2018-12-13) there was breaking changes for angular tabs.\u003cbr /\u003e\nThe usage of ion-tab was removed and it's not necessary to use named outlets.\u003cbr /\u003e\n\u003cbr /\u003e\nA common mistake is that not all continuing routes (child-routes) are defined in the children-block.\u003cbr /\u003e\nIf you don't define it in the child-block routing may seem to work,\u003cbr /\u003e\nbut things like *ion-back-button* are fucked up.\n\n## Router Tree\n\n![Router Tree](https://i.imgur.com/2JAZAdT.png)\n\n## Getting Started\n``` \ngit clone https://github.com/servrox/demo-ionic-tab-routing.git\ncd demo-ionic-tab-routing\nyarn\nionic serve\n```\n\n## Built With\n\n* [Ionic CLI](https://ionicframework.com/docs/cli/) - version 4.10.3\n* [Ionic Framework](https://material.angular.io/) - @ionic/angular 4.0.1 \n\n## Authors\n\n* **Marcel Mayer** - \n[servrox.solutions](http://servrox.solutions)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservrox%2Fdemo-ionic-tab-routing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fservrox%2Fdemo-ionic-tab-routing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservrox%2Fdemo-ionic-tab-routing/lists"}