Advanced Search
Search Results
15 total results found
Angular: Sorting Arrays
Here’s a simple technique for sorting an array of objects. It accepts a simple function that returns a 1 or -1 result. // The questions property is an array of objects with a display order property. // We want them to be ordered ascending. // NOTE: The sor...
How to Override Styles of Third-Party Components
This is a quick how to, for overriding the styles used inside third party angular components. For example: The Clarity angular library includes a datagrid (clr-datagrid), which has an obligatory margin at its top and bottom, which creates too much whitespace ...
How to Set Properties of a Web Component
Attribute binding can get complex. Here’s a running list of examples of how to do it. To set properties on a Web Component use the Angular [property] binding syntax. To listen to events use the Angular (event) binding syntax. <!-- - status - attribute sty...
How to Override Property Type In Derived Interfaces
Sometimes, an interface is created that the wrong datatype for a property.This can be because the interface is from a third-party or because you are composing a more specific interface type and need to swap out more generic properties of the base type. Taken ...
Jenkins Notes and Links
Here are links to Jenkins references. Jenkins User Manual: Jenkins User Handbook Dealing with the Jenkins System Account: Jenkins: Home Profile
NVM - Node.js Version Manager
When maintaining Angular apps and other Javascript-based libraries, you will come across the need to have a specific version of Node.js running on your development host.Node Version Manager, is a Windows based package, that will swap in desired versions of Nod...
VSCode CORS
When debugging webUI projects in VSCode, it can be necessary to disable any CORS checking, so that VSCode can serve your app, while your backend API calls point elswhere. Aside: For more information on how to debug Angular applications in VSCode, see this: De...
Angular: Add Query Parameters without Router
Sometimes it is necessary to add query parameters to a REST API url without going through the Angular router logic, such as when doing paginated lists on large tables. To make this easy to do, just use the HttpParams module. Import it with: import { HttpPar...
Angular Dynamic Routing
Here’s a technique for implementing dynamic routing, where we want a common page or component to serve multiple route paths. If you’re interested in passing query parameters through Angular routes, see this: Angular: Add Query Parameters without Router Imple...
Angular: Get Button Name
When building navigation, or handling button clicks, it’s sometimes necessary to retrieve the name of a button (or other control) from the click event. This is done by drilling into the MouseEvent that is passed into the handler. Basically, we get the target ...
Angular Context Menu
Here’s some notes on context menus in Angular. This article was used as basis: Context Menus Made Easy with Angular CDK The above article reference included a working StackBlitz, downloaded, here: angular-yd6ay3.zip It uses the overlay functionality from An...
Typescript This
Taken from an older version of the Typescript handbook, as the latest does not include this, but is still relevant. This Learning how to use this in JavaScript is something of a rite of passage. Since TypeScript is a superset of JavaScript, TypeScript develo...
HTML CSS Prevent Text Selection
Here’s a simple css style you can add to your styles.scss of any project, to prevent user selection of text. .prevent-select { -webkit-user-select: none; /* Safari */ -ms-user-select: none; /* IE 10 and IE 11 */ user-select: none; /* Standard syntax ...
Angular: Access CSS Variables
CSS Variables can be defined in css (or SCSS) like this: NOTE: These are defines in the root element, in the styles.scss file of an app. :root { --sidenav-width: 300px; --sidenav-collapsed-width: 50px; --sidenav-background-color: var(--app-bac...
Web Push Notifications
Here’s some initial references for setting up Push Notifications in web pages. Service Worker API - Web APIs | MDN Push API - Web APIs | MDN Push notifications overview | Articles | web.dev Push notifications are now supported cross-browser | Blog |...