Learning Angular by using it on my blog
2023-10-05
2023-10-05
I wanted to share a little adventure I had while learning Angular. My blog at abelcastro.dev was doing just fine with Django, but I thought, "Why not tinker around with Angular and learn some new skills?" So, I created a playground at ng.abelcastro.dev and decided to see what I could do!
Angular is a fantastic toolbox for making web applications more interactive. Even though my blog was working perfectly with Django, I wanted to learn Angular just for the sake of learning, not necessarily to make it look fancier.
First things first, I set up a separate space for Angular at ng.abelcastro.dev. This way, I could experiment and learn without interfering with the good old Django backend.
To make things flow smoothly, I created a pathway for my Angular app to access the blog's data using a RESTful API at `abelcastro.dev/api/posts´ in my Django backend. This API helps Angular fetch blog posts.
In the Django world, I used the Django REST framework to create the /api/posts
endpoint. This way, my Angular app can easily fetch the blog post data it needs.
Inside the Angular app, I used Angular's HttpClient module to fetch data from the Django backend's /api/posts
.
You can find the repository for my new angular blog here 🚀.