Tuesday, October 22, 2019

I have finally finished Chapter 7 of "ASP.NET Core 2 and Angular 5" by Valerio De Sanctis.

I think it was my new years resolution to finish this book this year. It's not going to happen. Maybe I can finish it by the end of 2020 when it will be really out of date. Ha! Chapter 6 on LESS and Chapter 7 on Angular's reactive forms have really taken the wind out of my sails, and I'm no longer doing the coding examples along with the book. I have decided that it is enough to just read in the book. Anyhow, I am now on the other side of Chapter 7 so maybe I can be enthusiastic anew. Here was what was in the last few pages of Chapter 7 that interested me:

  1. A new form was made from a FormBuilder named fb like so:
    this.form = this.fb.group({
       Text: ['', Validators.required]
    });

    ...and interesting things shown to be hanging off of form include:
    .value
    .status
    .dirty
    .valueChanges.subscribe
    .get("foo").valueChanges.subscribe
    The subscribes require, yes, unsubscribes.
     
  2. Page 349 suggests the built-in pipes in Angular 5 are DatePipe, UpperCasePipe, LowerCasePipe, PercentPipe, and JsonPipe. You can probably guess what the first four of these do. The JsonPipe takes a JSON object and turns it into a "pretty-printed JSON" string in the name of testing stuff and barfing readable JSON up to the display.
     
  3. If you have a string with HTML in it you cannot spit it into view with the string interpolation double curly braces syntax. Therein HTML tags will be stripped out. The way around this is decorate the wrapping tag like so:
    <div [innerHTML]="thingToShowOff"></div>
     
  4. Page 354 makes mention of the "Local" window in Visual Studio 2017 and what it probably means, in spite of yet another typo, is the Autos and Locals windows that you may serve up while stopped on a breakpoint while debugging. These will both be options under the "Windows" option under the "Debug" menu at the top navigation if you are debugging and will otherwise not show up. Autos shows you all variables available then in that moment and Locals shows "local scope" stuff like what is tied to the this keyword.
     
  5. WebPackMiddleware was namedropped on page 355. Again, maybe a typo? Maybe what was meant was webpack-dev-middleware perhaps. Googling against this stuff, I get the impression that the middleware for webpack will allow for hot swappability of modules and other esoteric things of that ilk.
     
  6. Page 355 also mentions the "Angular testing utilities" which are built-into-Angular testing goodies. TestBed is amongst this suite of stuff.
     
  7. The last page in the chapter suggests the template-driven stuff is a carryover from AngularJS.

No comments:

Post a Comment