# Removing a Page / Component

## **Steps to remove undesired page from the App**

Removing a page from the app is pretty straight-forward. You just remove the target folder from the code, and remove the routing associated with it. Also, if this folder or any of its child pages are imported in some other page, you need to remove those as well.&#x20;

In some cases, there can be nested routing. Let's see an example of removing a nested routed page - Netflix Layout

* Go to `app-routing.module.ts` file.
* Check if the page you want to remove is a direct child of main routing, or is a nested routing child. In our case, `Netflix` page is directly routed

![](/files/-LuaxcOk_McWLznbJvjN)

* Select and delete the route
* Also, check if `Netflix` page was imported in some other page, and remove that import and its usage as well
* You should remove the `Netflix` code folder from the project as well, but you can choose to keep it if you think you'll need it in future

## **Steps to remove undesired component from the Ap**‌p

{% hint style="info" %}
Components do not have direct routes in routing files, but they are often imported in many different pages and/or components.
{% endhint %}

* Locate the component folder in the project. Note the export variable name as this will be used for importing the component in other pages / components

![](/files/-LuayHGQis2JPMU_wgvD)

In this case, we can see `GoogleLoginComponent` as the export variable.

* Do a global search of this variable name, and remove the imports from all the files

![](/files/-LuayVIS0Kyr9EdKn0ZS)

* Components are generally shared via `sharable.module.ts` . In that case, you'll have to remove the variable from `declarations` and `exports` array of the `sharable.module.ts` file
* Along with the imports, you will have to remove all the features using these variables as well
* You are free to delete the component folder or keep it in the project. Once the imports are removed, it won't affect remaining code


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://enappd.gitbook.io/capacitor-full-app-ionic-angular/removing-a-page-component.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
