Brian
Member since Jan 24, 2018
- Profile: /members/13693-brian.htm
- Comments: 7
Recent Blog Comments By Brian
-
Providing Module Configuration Using forRoot() And Ahead-Of-Time Compiling In Angular 7.2.0
Posted on Dec 21, 2019 at 2:44 PM
@Brian, I'm so wrong here! I just tried to build my library with ng serve lib --prod , and had to come back here as I'm getting the exact errors mentioned. Talk about speaking too soon:-) Great article btw... read more »
-
Providing Module Configuration Using forRoot() And Ahead-Of-Time Compiling In Angular 7.2.0
Posted on Dec 21, 2019 at 11:35 AM
Instead of using a class for the options, use an object with an InjectionToken const DEFAULT_OPTIONS = { a: 1, b: 2 } static forRoot( options?: ModuleOptions ) : ModuleWithProviders { ..... { provide: FOR_ROOT_OPTIONS_TOKEN, useValue: {DEFAULT_OPTIONS, ...options} } } In the s... read more »
-
Translating Viewport Coordinates Into Element-Local Coordinates Using Element.getBoundingClientRect()
Posted on Dec 8, 2019 at 9:01 AM
@Marc, I have looking into finding the local click coordinates on an element where the parent has both translate and scale applied e.g. transform: translate(200px, 200px) scale(1.5); Surprisingly, the MouseEvent.offsetX and offsetY were still local to the element and to the original sc... read more »
-
Wrapping Immutable Arrays In Mutable Arrays For Easier Processing In Angular 8.2.0-next.0
Posted on Jul 25, 2019 at 2:54 PM
Hi. We do a lot of transformation on data we receive via APIs where I work, but our concept of immutability is different from above I think. When we retrieve data from a service, the collection is mapped and each object cloned before being returned (using lodash/fp - compose map assign etc) ... read more »
-
Webpack 4 Automatically Makes process.env.NODE_ENV Available In Your JavaScript
Posted on Jul 17, 2019 at 7:00 AM
I ran into the process.env.NODE_ENV problem when migrating an Angular Application to use Universal Rendering There is an ng add @nguniversal/express-engine schematic - which worked very well. During the production build process, it uses webpack to bundle the Express server.js - whe... read more »
-
My First - And Possibly Last - Look At Reactive Forms In Angular 7.2.13
Posted on Apr 24, 2019 at 10:04 AM
Great article. Quick question - how come you use ng-template with [ngFor] rather than ng-container with *ngFor ? It's funny, as I had just read your article about the difference between the two:-)... read more »
-
Creating A Jump-To-Anchor Fragment Polyfill In Angular 5.2.0
Posted on Jan 24, 2018 at 6:05 PM
I'm struggling to see the need for the Directive. I have implemented something similar, listen to the ActivatedRoute fragment's, then do a document.querySelector, and scroll to the element if it exists. Don't see the need to have a directive wrapping every [id] element... read more »