This past week I took a stab at implementing NgRX 4 Lazy Loading and learned a few things that weren’t obvious to me. I thought you’d want to hear about them.
I made a tweak to my Angular code process over the last month or so that has resulted in greater productivity in my development environment and fewer bugs.
Now, I didn’t make this change because I thought it would improve my productivity. At least that wasn’t the primary reason. I made the change because I thought it would reduce the chance of introducing bugs into my code. And while it does reduce the number of bugs in my code, the result has been generally improved productivity.
What is this great secret?
But, here’s the deal. “Just because you can, doesn’t mean you should.”
The thing that makes me most nervous about Angular is that it is structured so that you can write some really clean code. But, you don’t have to. Which mean most won’t.
So, here are a few things you need to know about TypeScript that will make you a better Angular developer.
In the old world where all of our pages were on the server and every change on the client side required a full round trip to the server, each page was a unique URL on the server. In the SPA world, we only load one “Page” from the server and the client takes care of making it look like we have moved from one page to another.
When done well, we can create pages that reuse existing content on the screen causing a minimal screen refresh while still allowing the user to link to a specific “Page” in our application.
These “Pages” are called “Routes” As in, here is the route to some code I want to execute.
Over the last couple of months, I’ve discussed specifics about Angular architecture. Today, I want to discuss a more general question. “Where do I put what files?”