Angular .component() $doCheck lifecycle event

I will assume you are already aware of the awesomeness that is angular components. Even if it is just sugary coating around the directive, it's still sweet. So to wrap up the events we have had at our finger tips thus far. $postLink $onInit $onChanges $onDestroy I dont know where I stumbled upon the latest one, but I did. Let this be your stumbling ground! $doCheck() This is a nifty little event - introduced to us in Angular v1.5.8 - allows us to fire off a method on each turn of the digest cycle. As per the docs it provides...

Service Worker Precache

Service worker is probably one of the coolest new additions in the sea of cool new additions to the world of Front-End Development. It is however a pretty daunting API to get a hold of when you are starting out with it - fetch, cache, oh boy. The simplest way to get started with integrating service worker is to precache all your static files - aka the JS, CSS and and assets you might have. Now this presents a problem. What about when the assets change does that mean we need to manually maintain this file? That seems like a...

Base Tag in Angular Apps - Resource interpreted as stylesheet but transferred with MIME type text/html

This will be a short and sweet post. I have noticed as its one of my highest rated answers in Stack Overflow I thought I would drop the knowledge into my blog as well. If you have clean happy URLs in you angular app - and really who wouldn't want that - you are using the $locationProvider. Then yuo have this code snipped in the config section somewhere. $locationProvider.html5Mode({ enabled:true }); But if you are missing the base tag you will get this error. Error: [$location:nobase] $location in HTML5 mode requires a <base> tag to be present! Ok no problem...

Angular .component() Method

Welcome to the future - enter the component method. Ok so I guess this will be logically broken up into a few sections - the component method, new life cycle event, the new component controller - the replacement for the linker function and now yes DOM manipulations in the controller. Oh boy the last one you might be thinking - but that is one of the fundamentals we learn - also a massive mistake people make either through ignorance, laziness or a combination of both. Component Method First up the component method. I was first introduced to it though this...

Cool CSS stuff - Part 2 - SCSS as JS

For me CSS or SCSS is a ways to a means - we need to style elements. However my pleasure on the front end come mainly from JS and the puzzles we get to solve creatively. So when I started playing around with loops and conditional statements in SCSS, I was super excited to see that SCSS can also be a fun way to solve styling issues with more traditional programming techniques. My problem to start with was creating a carrot/triangle pointing to the right. So I started to search the net and came across this cool post about using...
pow wow!