I just had the awesome opportunity to TA and sit in on a 2-day Angular 2 course instructed by one of the top teachers in the web development world and the hungry mind behind One Hungry Mind Blog, Lukas Ruebbelke (@simpulton). It was especially humbling because his eggy bookmarks course was one of the very first times I really dug in and started writing Angular code. It felt like meeting a childhood hero or Santa Claus. I had spent so much time watching his videos that it was surreal to meet him in person, and yes he is really that goofy and funny in real life. haha. Anyway, even though I have been using Angular 2 for a little while now and the course was aimed more for beginners, I still took about 4 pages of notes and learned a ton while I was there. Plus, it was great to get a refresher/confirmation on some basic concepts and some new perspective on how to think about certain other things. In this post I've written a bullet point list of some after-the-fact thoughts while looking back at the notes I took during the lectures. Enjoy!
Tips & Takeaways
You can also use the double wildcard path to set a route to load up when an unrecognized route is entered:
The reason why this is not super great is that it imports ALL exported things from the file. In general, you should try to import only the things you are using or import a whole barrel.
you could do it like this:
And for events instead of:
you could do this:
Lukas called this the "colloquial HTML" way of doing it. It's definitely not as sexy as the regular way (imho). You will probably never see these colloquial versions in real life, but it's still cool to know they exist.
I think this is a pretty cool way to do it, and having a completely functionless component sounds really exciting, especially when it comes to writing unit tests for it (since there pretty much are no tests to write for full coverage). ;)
Although Lukas noted that there will be an even nicer syntax for doing this in Angular in the near future. :)
Overall, I think Lukas is an very smart guy who is extremely knowledgable about Angular and web development in general. I think he could take a dare to talk about the most boring subject possible and would be able to make people laugh the whole time, just being himself. He's always looking to find the best practices and uses his own judgment to ensure they make sense before passing them on to us mortals. He has a gift for breaking down complex things into understandable nuggets of information, and he makes it seem like we are all just friends sitting in a room together, hanging out, talking about Angular; you know regular, everyday stuff. If you ever get a chance to go see him talk in person I highly recommend it. Thanks again Lukas, can't wait for the next time you come out to NYC! :)
The posts on this site are written and maintained by Jim Lynch. About Jim...