#13: π§ Refactor App Component
Last updated
Last updated
We're going to perform a small refactoring. The app-root
shouldn't have such a large template and all this logic. It should just call another component that will deal with that.
Create a new component called list-manager
:
StackBlitz Instructions
Use the Angular Generator to create the component, then make the component use an inline template. Continue with the remaining instructions on this page.
Move all the code from app-root
to list-manager
.
You can keep the title in app-root, and give it a nice value.
Be careful not to change the list manager component's class name!
Call the new component from the app-root
template:
That's it! Now we can go on.
πΎ Save your code to GitHub
StackBlitz users - press Save in the toolbar and continue to the next section of the tutorial.
Commit all your changes by running this command in your project directory.
Push your changes to GitHub by running this command in your project directory.