diff --git a/docs/en/Community-Articles/2023-04-15-Converting-Create-Edit-Modal-To-Page/POST.md b/docs/en/Community-Articles/2023-04-15-Converting-Create-Edit-Modal-To-Page/POST.md new file mode 100644 index 0000000000..ccba01247f --- /dev/null +++ b/docs/en/Community-Articles/2023-04-15-Converting-Create-Edit-Modal-To-Page/POST.md @@ -0,0 +1,325 @@ +# Convert Create/Edit Modals to Page + +In this document we will explain how to convert BookStore's Books create & edit modals to regular angular component pages. + +## Before + + + +## After + + + +# BooksComponent + +This is the main component of the books management. Create & Update operations are done in this page. So we'll remove create & update operations from this page and move a separate angular component for each operation. Each component will be a page. + +- Remove Create & Update modal on template + +  + +- Modify **NewBook** button with a link to **CreateBookComponent** page. + + ```html + + ``` + +- Modify **Edit** button with a link to **EditBookComponent** page. + + ```html + + ``` + +- Remove all unused methods and variables in the `BookComponent` except **book** variable, **ngOnInit** and **delete** methods. + + +  + +- Also we can clear unncessary imports + +  + + + +# CreateBookComponent Page + +Create new component by name `create-book` in your project. +```bash + yarn ng g c book/create-book --skip-tests --style=none +``` + +- `create-book.component.html` + +```html +