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

Creating An Input-Driven AutoFocus Directive In Angular 5.0.2

HTML form elements already provide for an “autofocus” attribute that will pull focus to an input field after it is rendered on the page. This is great for static pages; but, in my experience, using the autofocus attribute in an Angular 5 application can be a bit hit-and-miss. It will often work the first time that an input is rendered; but, it will then stop working even if that input is hidden and re-rendered. As such, I usually end-up creating an autofocus attribute directive that wraps the focus workflow in a timer. Encapsulating the autofocus in an attribute directive has the added benefit of being able to (somewhat) programmatically control which input receives focus.
Source: Creating An Input-Driven AutoFocus Directive In Angular 5.0.2

Angular Material — Part 4: Data Table – CodingTheSmartWay.com Blog – Medium

This post has been published first on CodingTheSmartWay.com.

This is the fourth part of the Angular Material series on CodingTheSmartWay.com. In this part, we’ll be focusing on Data Tables. Of course, this part again assumes that you’re familiar with the Angular Material library in general and that you know how to setup an Angular project and install the Angular Material library in that project. If you’re new to Angular Material please first take a look at the first part of this series: Angular Material — Part 1 Introduction or visit the Angular Material Website at https://material.angular.io .

Source: Angular Material — Part 4: Data Table – CodingTheSmartWay.com Blog – Medium

Angular Elements and SPFx – Winsmarts.com

Angular is pretty good. But it likes to own the page, if not the whole website. It is hard to,

a) Have Angular co-exist with other stacks

b) Inject angular for one small quick job

c) Package an angular “widget” for use in wordpress, sharepoint, etc.

Interestingly, this is something AngularJS used to be able to do, but Angular has sort of lost this on its way. Technically all of the above is possible with Angular, but it’s complex. Very complex.

And this is exactly the gap that Angular Elements fulfills.

Source: Angular Elements and SPFx – Winsmarts.com

Angular Runtime Performance Guide – The Oasis Digital BlogThe Oasis Digital Blog

Smooth, highly-responsive interfaces increase users’ confidence in an application and create an overall positive experience. Whereas small applications with simple interactions are built without a focus on runtime performance, standard approaches sometimes do not scale well as the data size or feature complexity increases. A common scenario that may be familiar to the reader is a table that works well with small quantities of data but begins stuttering and lagging when the amount of data is increased. This guide will show how to increase performance in these kinds of applications.

Source: Angular Runtime Performance Guide – The Oasis Digital BlogThe Oasis Digital Blog