Drag and drop in Angular

Overview 📄 Dragging and dropping has never been easier! Lets make use of the Component Development Kit (CDK) along with Angular 7+ to make some draggable divs in less than a minute! CDK setup ⚙️ Make sure you are on at least V7 of Angular. You can check this by running ng version from your chosen CLI (if you have the Angular CLI installed globally). Start by creating a new project....

February 1, 2019 · 1 min · Phil

Use of the :host selector

The :host selector can be used to target custom components from within a css environment. Let’s have a look! 👁️‍🗨️ Given you have a custom component such as; <album></album> In your css you may want to style the album element from within it’s inline stylesheet. This is where the :host selector comes in handy. Consider the below usage to add 10 pixels of margin to the album element. :host { margin: 10px; }

January 9, 2019 · 1 min · Phil