Blog

Using Angular Route Guards to Limit Access by Roles

Angular route guards are very popular for restricting access to parts of an application. Perhaps the most popular use of route guards is checking if the user is logged in period. The guard will check the authorization status of the logged in user, and if they are approved it returns...

Loading App Configuration in the APP_INITIALIZER

If you're anything like me, you've been placing the configuration for your Angular app in the environment.ts file, and then copying that same file to environment.test.ts and environment.prod.ts files. Which isn't too bad; most of those values don't change too often. But sometimes they do. And when they do, that's...

App Config Editor Project

Every application needs some amount of configuration. That's one of the more obvious sentences I've ever written, but it's true! And it can be a little bit of a pain to manage that configuration, especially in Angular applications. At least that's what I thought until recently. A little while ago...

ES6 Code in an Angular Project

I was recently working on an Angular project where I was loading a JavaScript file into the application in the .angular-cli.json file (the same would happen if your file is the angular.json file). The file was pretty simple, only about 40 lines at most. But it was using ES6 syntax...

TemplateRefs in Angular

If you're anything like me, you've heard of TemplateRefs in Angular, but didn't know what that meant. And it probably scared you off from learning what they are or how they work. But it's really not that scary of a thing to learn. It just takes a little bit of...

Global Error Handling in Angular

You're probably wondering why I'm writing a blog post on error handling, since we all write code that never has errors. Right? If you're anything like me, you know that's just not true. Errors are obviously part of development. We obviously work to eliminate as many as possible. But gracefully...

:focus-within

It's been awhile since I've really spent time working in CSS, but I've recently had to build a template at work. It's taken a bit to get back in the swing of things, but I've learned a lot of cool new tricks. Well, at least new since the last time...

ngGirls and ng-conf 2018

I've had a crazy 6 weeks since ng-conf, but man it was great this year. This was my third year, and it was probably the best year I've been. It gets better and better each year. One of the best parts was ngGirls on the Tuesday before the conference started....

Angular, Node, and Auth0

I needed authentication for my Angular app (which has a Node.js backend) on a recent project, and so I started looking at options and decided to use Auth0. There are a lot of options, including using passport-local and doing authentication on your own. But to avoid managing users and security...

If I Can Do It, You Can Too!

I've tried to write this post multiple times. I could never find the right way to word it though, or felt like nobody would care. But I was thinking about how my career has gone so far, and how lucky I feel, that I want to give one other person...

Dockerizing Your Angular App

Building Angular apps has never been easier than when using the CLI. It's super easy to generate components, services, and modules. It's also really easy to do a production build of your code. But what wasn't so easy for me was taking the next step and actually deploying the app...

Authentication with Angular and Sails

I recently had to convert an application from using session-based authentication, managed by passport and Sails.js on the server, to JWT authentication. This is a quick breakdown of the steps used to accomplish this. Angular Let's start on the Angular side of the application. So for authentication, we need our...

Finding an Object in an Array with Waterline

Sails.js is one of my favorite Node frameworks. There are a lot of built in advantages that make getting up and running quick, easy, and painless. One of the benefits is the ORM/ODM that it comes with, Waterline. There are a lot of adapters that allow you to use many...

Installing SQL Server for Docker

SQL Server is a powerful database option to use, but up until recently it's not been possible to use it unless you were on a Windows machine. Well, that's changed (along with many other Microsoft products). This week at work I decided to finally jump in and get SQL Server...

Configuring Angular Services

This week I needed to turn an Angular module into an npm package that I could import into multiple projects. The tough part was that in this module, there was a service that posts to a URL which needed to be configured. Luckily, Angular provides a pretty simple way to...

Angular HTTP Error Interceptors

Angular 4.3 introduced HTTP interceptors. This gives you the ability to handle every outgoing http call and every incoming response, all in one spot. Most of the examples I've seen out there cover the first, with each call having an authentication token attached to the call. I needed a way...

Why Sails.js?

Today I got the opportunity to give a presentation at Dev Mountain in Provo, UT on why you should use Sails.js, an MVC framework for Node. There are a lot of reasons, but I wanted to share some of my favorites. Blueprints One feature of Sails that is really useful...

Vertical Centering HTML Elements

I dont' know how many of you have tried to vertically center HTML elements before, but it can be a big pain in the butt. A coworker had once given me some hints and a couple of CSS classes that I could use to achieve it. It really wasn't easy...

ngConf 2016 Recap

Last week I attended my first ever developer conference. Or any conference, for that matter. ng-conf 2016 was a blast! I happened to get a chance to buy a ticket late, way after I thought I'd even have a chance at attending. At the beginning of April I got an...

React.js Tutorial Recap

Today I finished my first beginner tutorial on React.js from Pluralsight. It was a pretty simple app, where you have the numbers 1-9, and you have to choose the proper numbers that add up to the number of stars that show up. The game ends when you use all your...

Getting Data with React.js

This lesson in the React.js tutorial I'm doing focused on getting data from the GitHub API and displaying it, dealing with user input, and looping through an array of items and outputting them. Getting Data Getting the data was actually quite simple, by using jQuery to make a $.get call...

Getting Started with React.js

I decided I really needed to start learning React.js. It's the big thing these days, and I don't want to get too far behind, so I'm starting to get on the bandwagon. I still have access to Pluralsight, which has been great so far for other stuff I've been doing,...

Sublime Text 3 Setup

The more I use Sublime Text, the more convinced I am that it's the best text editor there is. It's just so powerful, has so many plugins, and offers users so many more options than other editors. I read through @wesbos's book, Sublime Text Power User, and my developing life...

ST3 ASCII Replacer Plugin

I wrote my first Sublime Text 3 Plugin! Granted, it's nothing overly complicated, but it will save me a lot of time. I spend a lot of time copying and pasting text from Photoshop mockups, or from e-mails, or whatever it may be. I would then always forget to double...

AngularJS and Firebase

I recently found a pretty cool new piece of web development technology: Firebase. You can read more on their site, but basically Firebase is a way to instantly sync data across devices. If you make a change on your computer, it instantly shows up on your phone. They take care...

AngularJS Services

I wrote my first AngularJS service today. It was nothing big, I was just trying to keep from repeating code on every screen. On the site, an alert shows up after a user adds or updates a record. Angular-ui-bootstrap was giving me most of the functionality I wanted, but it...