Step 1: Create a New Angular App
Choose CSS and say No to Angular routing when prompted.
Step 2: Generate Components
Step 3: Create Blog Model
Create a file named blog.model.ts
in the src/app
folder:
Step 4: Create Blog Service
Update blog.service.ts
:
📄 Step 5: Blog List Component
blog-list.component.ts
:
blog-list.component.html
:
✍️ Step 6: Blog Form Component
blog-form.component.ts
:
blog-form.component.html
:
Step 7: Enable FormsModule
In app.module.ts
, import FormsModule
:
Add it to the imports
array:
Step 8: Update app.component.html
Run Your App
Open in your browser: http://localhost:4200
No comments:
Post a Comment