I gave a talk at Djangocon earlier this week on Angular 2 and Django REST – not so much an intro to Angular 2 (you can go through a tutorial for that), but talking about why Angular 2 is something to pay attention to, plus looking at how you might use Angular 2 and a framework like Django REST together.
Why pay attention to Angular 2?
Three important points:
- Deploy to any target
- Choose your own language
- Web components
Deploy to any target. Unlike Angular 1, Angular 2 doesn’t have a baked in conception of the DOM. That’s a really big deal! It means you can use Angular 2 in places without a concept of the DOM, such as building cross-platform apps with NativeScript. That’s awesome!
Web components. Web components are awesome! But … the browser standards aren’t quite there. Angular 2’s components are meant to be future-forward compatible with web components (when we eventually get them), so you can start using this architecture today in the context of a framework that’s performant.
The last API I built in Django was using Tastypie, but for this talk I wanted to use Django REST since it’s gaining steam in the Django community. And wow, is that thing pretty cool! With fairly little configuration, you get a web-browseable API, with all the methods working (GET, POST, DELETE, etc.). The quickstart tutorial is nice and fast, so check it out!