Photo by Joshua Hoehne on Unsplash

Let’s say you’re building an app where you allow users to upload images, and there’s an expectation that those images should be “secure” — specifically, that they can only be accessed by logged-in users with the appropriate level of access.

One way to handle this is to serve the file with PHP, rather than with Apache or Nginx (your webserver). If you’re serving things from PHP, you can use control-flow ( if statements) to serve an image (or not) only after checking that the request is on behalf of a user with correct permissions.

I won’t go into user auth…


Photo by kevin Baquerizo on Unsplash

When creating a project, sometimes you set out to build a feature with a certain scope, only to realize that you can generalize the use-case, and turn your feature into more of a helper for future features. Perhaps you’ve already built the helper, and it works great, but unfortunately, you realized all of this in the shower this morning, and you committed your work last night — and on that commit, you named the helper within the context of the feature you were building.

In this situation, and many others, it can be useful to be able to rename your…


Photo by Victória Kubiaki on Unsplash

In the world of React, a common approach for sharing data between components that don’t have a direct parent-child relationship, is to use technologies such as Redux to create a centralized “store” of data/state.

While one could build a Redux-like setup in Angular, it can be overkill for a lot of use cases. We simply want to be able to set some piece of state in one component, and use it in another component. Or, many other components.

Angular comes with a lot more out-of-the-box than React… that’s a big distinction between the two. …


Photo by Andrea Lightfoot on Unsplash

Answer: You can’t. Props aren’t a thing in Angular.

But that’s not really why you’re here. You’re here to find out how to, generally speaking, pass data from parent to child components in Angular, in a similar way to passing props in React.

This code was written in an Angular 9 application I’m developing called Go Room, but should also apply to Angular 10 apps. To demonstrate this functionality, we will build an Image component that can be used to generate divs with background images — a standard way to make images that aren’t directly “draggable” from the page.

Let’s…


For the past few months, like many of us, I’ve been working remotely. Three weeks ago, I journeyed out of New York to a small town, and it’s been really amazing. Being around nature is something I forgot could be so pleasant. This place is certainly bereft of cultural opportunities, but so is Brooklyn at the moment.

The biggest challenge of this relocation has been internet speed. I’m working off of my cellphone hotspot, and enjoying the the temporary “unlimited” data from Mint Mobile, but compared to my home connection in Brooklyn, there’s been a big decrease in bandwidth. But…


Let’s say you’re building an app that is oriented around user identity — the ability for users to interact with the site and with each other as themselves. The typical approach (e.g. the one Facebook uses), is to ask the user to create an account before logging in and being able to do anything meaningful.

Requiring users to enter their email address and risk another data breach on a site they haven’t even tried yet, has the potential to severely impact your conversion rate. …


Let’s say you want to provide your users with driving directions to your locations, and you want the directions to load on every page load. When you’re designing that page, you’ll want to be able to reload it many times, and quickly, so you can try out adjustments and build functionality. The Google Maps API provides the data we need, but unfortunately, making constant requests on every refresh during development can slow down the process quite dramatically. To that end, it would be nice to be able to simply simulate the API.

It’s important to first understand your goals. When…

Ben Hickson

Software Engineer and Filmmaker — https://benhickson.com, https://github.com/benhickson

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store