Mindblown: a blog about philosophy.

  • ES6 Destructuring Recipes

    ES6 Destructuring Recipes

    ES6 Destructuring is awesome, but it’s not always obvious how you can use it to its most awesome extent. In this post, I’ll show you just some of the ways you can make maximum use of destructuring to make your code terser and cleaner. General Destructuring Recipes Destructure the results of promise.all Promise.all accepts an […]

  • Advanced ES6 Destructuring Techniques

    Advanced ES6 Destructuring Techniques

    Going even deeper into ES6 destructuring now, this post shows how to get maximum awesomeness by using destructuing on deeply nested objects, functions, generators, and even regExes! Destructuring Arrays and Objects together In my previous post on how to actually use ES6 destructuring, I showed separate examples for array destructuring and object destructuring. But what […]

  • The Most In-Depth Yet Understandable ES6 Destructuring Tutorial (complete with Assembled Avengers)

    The Most In-Depth Yet Understandable ES6 Destructuring Tutorial (complete with Assembled Avengers)

    Destructuring is a new ES6 technique for extracting data from JavaScript objects and arrays using a much tighter, terser, and clearer syntax than that provided by ES5. The result is not just the saving of a few bytes of code; destructuring can change the way you code in radically new ways, and the more you […]

  • How to mock the Date to keep date-based unit tests predictable

    How to mock the Date to keep date-based unit tests predictable

    When unit testing functions that use the Date.now() function, you’ll need to lock down the value it returns – otherwise, your unit tests will only ever run successfully on the day (or even the minute!) that you run them. This article shows how you can override Date.now() to make it return a predictable value. Step […]

  • How to fix the “Controller ‘ngModel’ required by directive” error

    How to fix the “Controller ‘ngModel’ required by directive” error

    The ‘controller ngModel required by directive’ error can be confusing when you first come across it, particularly if you get it when running your unit tests. But it’s a simple fix, and obvious when you understand what Angular’s trying to do. Tl;dr This error is caused by a directive with require: ‘^ngModel’ in its definition […]

  • Introducing Untangled Angular Seed – a best practice Angular Seed app that gets out of your way

    Introducing Untangled Angular Seed – a best practice Angular Seed app that gets out of your way

    Larger Angular apps can be difficult to setup due to the many moving parts involved. Various Angular seed apps exist that provide some of the boilerplate code involved, to help you develop your app more quickly. However, what most add in removing the boilerplate you need to write, they take away in adding unneeded complexity, […]

  • Angular Connect Round-Up

    Angular Connect Round-Up

    The Angular Connect conference is almost at an end, so I thought I’d write up some of the great things I’ve learned over the past two days. It’s been an awesome conference. Different to last year’s ng-europe in many ways, but just as good. Here are the biggest take-aways: TypeScript is everywhere. All the Angular […]

  • What are your Angular Pain Points?

    What are your Angular Pain Points?

    Sometimes learning’s hard because what you’re learning is hard. Other times, it’s because the way in which you’re taught is bad. To help ensure this site gives you exactly the resources you need to untangle AngularJS, I’d be hugely grateful if you could fill out the form below. Otherwise, I’m solving my own problems, not […]

  • How to unit-test a directive with templateURL

    How to unit-test a directive with templateURL

    It’s best practice to place the HTML of a directive’s partial within its own file, and reference it in the directive’s definition object via the templateUrl property. However, this causes problems in testing, as most testing frameworks provide no access to the local file. This article shows you how to get around this limitation, and […]

  • Understanding AngularJS Promises 2: Promise callbacks or promise.catch()?

    Understanding AngularJS Promises 2: Promise callbacks or promise.catch()?

    AngularJS’s promises library ($q) provides two different patterns for handling success and failure: the callback pattern and the promise chain pattern (promise.then().catch()). In this article, we’ll look in-depth at the two different patterns, and see why you should always use the promise chain pattern, and why the callback pattern is a much abused Anti-Pattern. Tl;dr […]

Got any book recommendations?