> For the complete documentation index, see [llms.txt](https://enappd.gitbook.io/ionic-4-event-and-ticket-booking-template/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enappd.gitbook.io/ionic-4-event-and-ticket-booking-template/how-to-use-this-template/modifying-code.md).

# Modifying Code

## **Screen / View’s Code Structure**

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-Lqyt0VI2NO6-DvlMX5w%2FScreen%20Shot%202019-10-12%20at%201.04.34%20PM.png?alt=media\&token=e172906e-df70-49fb-a6ed-c6e2a743e393)

## **Overall Folder Structure**

There are broadly **20**+ pages in this template. All pages are shown in the `src/app` folder above. Mostly, each page’s code is kept in a separate folder. Folder names are self-explanatory. You can create a page by executing the command

```
$ ionic cordova generate page your_page_name
```

This will create a folder of page name containing four files as -

In the case of Ionic 4, pages are generated with lazy loading by default which means a page has its own module.

```
├── enappd.html
├── enappd.module.ts
├── enappd.scss
└── enappd.ts
```

* `enappd.html`: contains UI components for the page.
* `enappd.scss`: contains sass styles to style your page.
* `enappd.ts`: contains TypeScript code

## **Layout File Code Structure**

The layout file has the structure shown in the image.

• imports are written on the top.

• @component is the decorator that marks a class as an Angular component and provides configuration metadata that determines how the component should be processed, instantiated, and used at runtime.

• A constructor is used for dependency injections.

When the app loads the constructor gets called first then `ngOnInit`.

After constructor and inside the class we can write our logic for the page/component in `page.ts`&#x20;

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-LqytA9pjGm4jh4Z-NGz%2FScreen%20Shot%202019-10-12%20at%201.05.12%20PM.png?alt=media\&token=da852ff2-464a-4140-a6af-cceae0dffabf)

## **Styling**&#x20;

Style pages are generated by default for each page after executing page generate command, inside the page folder.

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-LqytHfjnrNbZl_Mwck7%2FScreen%20Shot%202019-10-12%20at%201.05.43%20PM.png?alt=media\&token=3a42e867-1dab-4762-bf7d-e5b22890a42c)

## **Navigation Code Structure**

On creating a project in Ionic4 a file named `app-routing.module.ts` gets generated by default where all the navigation codes get done.

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-LqytNvEz7YB-netBwIa%2FScreen%20Shot%202019-10-12%20at%201.06.08%20PM.png?alt=media\&token=29e67774-2927-4640-9507-8de46520396a)

We use the path name of a particular page to navigate from one page to another.-

## **Tabbed navigation**

Navigation for the Tabs is defined in `tabs/tabs.router.module` file. All the children of tabs are inside the tab navigation as well

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-Lqysrz8nzrPw893VkAP%2FScreen%20Shot%202019-10-12%20at%201.03.54%20PM.png?alt=media\&token=c58223f9-a2ea-4799-b5c1-6cb820c65b7c)

## **Segment navigation**

![](https://2554627188-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LqylcvVONLQChf6pSlN%2F-LqylmnwPToO67iFrqxv%2F-Lqytqt0SgRM1e1u1Noa%2FScreen%20Shot%202019-10-12%20at%201.06.49%20PM.png?alt=media\&token=23961119-90fc-4be8-89ef-5d8707ecb2dc)

Controls the navigation of Segments (Multiple Segment buttons in the Home page). This is detailed in `src/app/home`folder. All the settings of Segment Navigation can be controlled from here.
