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..a8f1aeadfa --- /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 the BookStore's Books create & edit modals to regular Angular component pages. + +## Before + + + +## After + + + +# BooksComponent + +This is the main component of the books management. The create & update operations are done in this page. So we'll remove the create & update operations from this page and move a separate angular component for each operation. Each component will be a page. + +- Remove the Create & Update modal on template + +  + +- Modify the **NewBook** button with a link to the **CreateBookComponent** page. + + ```html + + ``` + +- Modify the **Edit** button with a link to the **EditBookComponent** page. + + ```html + + ``` + +- Remove all unused methods and variables in the `BookComponent` except the **book** variable, the **ngOnInit** and **delete** methods. + + +  + +- Also we can clear unncessary imports + +  + + + +# CreateBookComponent Page + +Create a new component by the name `create-book` in your project. +```bash + yarn ng g c book/create-book --skip-tests --style=none +``` + +- `create-book.component.html` + +```html +