Notes on Angular Architecture Guide
After completing two beginner tutorials, I returned for another pass through the Angular Architecture Guide. These words now make a lot more sense when backed by the hands-on experience of the two tutorials. There are still a few open question marks, though, the long standing top of my list are Angular Modules. I think each of the tutorial is contained into a single module? That would explain why I haven't seen it in action yet. It doesn't help that JavaScript also has a "Module" concept, makes things confusing to a beginner like myself. And as if that's not confusing enough, there are also "Libraries" which are different from modules... how? I expect these concepts won't become concrete until I tackle larger projects that incorporate code from multiple different sources.
In contrast, Angular Components have become very concrete and these pages even use excerpts from the "Tour of Heroes" tutorial to illustrate its concepts. I feel I have a basic grasp of components now, but I'm also aware I still need to read up on a few things:
- Component metadata so far has been a copy-and-paste affair with limited explanation. It'll be a challenge to strike out on my own and get the metadata correct. Not just because I don't know what I should do, but also I haven't seen what the error messages are like.
- Data binding with the chart of four types of binding looks handy, I hope it's repeated and expanded in more detail elsewhere in documentation so I can get some questions answered. One example: I read "Angular processes all data bindings once for each JavaScript event cycle" but I have to ask... what's a JavaScript event cycle? The answer lies elsewhere.
- Pipes feel like something super useful and powerful, looking forward to playing more with the concept and maybe even create a few of my own.
- Directives seem to be a generic concept whose umbrella is fuzzy, but I've been using task-specific directives in the tutorial.
*ngFor
and*ngIf
are structural directives. Attribute directive was used in two-way data binding. Both types have their own specific guide pages.
Reading the broad definition of services I started thinking "Feels like my UWP Logger, maybe I can implement a logger service as exercise." Only to find out they're way ahead of me - the example is a logger (to console) service! I had hoped this section would help clear up the concept of service providers, but it is still fuzzy in my head. I understand the default is root, which is a single instance for everything, and this is what was used in the tutorials. I will need to go find examples of providers at other granularities, which apparently can be as specific as per component where each instance of component gets its own instance of that service. When would that be useful? I have yet to learn the answer. But at least I've written these questions down so I'm less likely to forget.