Articles for December 2017

Using Data Attributes To Pass Configuration Into An Event Plug-in In Angular 5.1.1

One of my favorite features of Angular is the ability to provide custom event bindings using the EVENT_MANAGER_PLUGINS collection. This feature allows you to create a clean abstraction around how event-listeners are attached to the DOM (Document Object Model); and, how those event-listeners interact with Angular’s change-detection algorithm. In most cases, the plug-in is powered by the event-binding in an Angular template. The other day, however, I ran into a situation in which I needed to provide additional configuration to the underlying event-listeners. Since these event plug-ins don’t have “inputs” like a traditional Directive, I had to use a different means of conveying the information. In the end, I used a Data attribute (data-*) to pass additional configuration into the event plug-in abstraction.

Source: Using Data Attributes To Pass Configuration Into An Event Plug-in In Angular 5.1.1

Creating PWA with Angular 5. Part 2: Progressifying the application

This is the continuation of my previous article, where we’ve created our first Angular 5 application. And I hope everybody has a successfully hosted project on github-pages.

But if you’re just joining us — it’s ok. To follow the next steps you only need a production-built version of any web application created with Angular 5 hosted on any web server or locally.

Source: Creating PWA with Angular 5. Part 2: Progressifying the application

Handling Global Keyboard Shortcuts Using Priority And Terminality In Angular 5.0.5

By Ben Nadel on 

Consuming global keyboard shortcuts in an Angular application (or any application for that matter) is a non-trivial task. Global key-event handlers often run into collision errors, unbind errors, and timing errors that can make debugging a nightmare. And while Angular provides easy semantics for binding to the Document and Window key-events, there’s no native construct for effectively managing these events across complex and deeply-nested applications. As such, I wanted to revisit this challenge and look at a potential solution that uses explicit event-handler priorities and terminal configurations.

Source: Handling Global Keyboard Shortcuts Using Priority And Terminality In Angular 5.0.5