javascript


Creating Custom AngularJS Directives Part 6 – Using Controllers

Creating Custom AngularJS Directives Series Up to this point in the AngularJS directives series you’ve learned about many key aspects of directives but haven’t seen anything about how controllers fit into the picture. Although controllers are typically associated with routes and views, they can also be embedded in AngularJS directives. In fact, there are many scenarios where custom directives can take advantage of controllers to minimize code and simplify maintenance. While using controllers in directives is certainly optional, if you’d prefer to build directives using similar techniques that you use now to build views then you’ll find controllers are essential […]


Getting Started with ES6 – Transpiling ES6 to ES5 with Traceur and Babel

In the first post in this series I introduced key features in ECMAScript 6 (ES6), discussed tools that can be used today to transpile code to ES5 so that it can work in today’s browsers, and listed several resources that will help get you started. Before jumping into the first official ES6 feature (that’s coming in the next post) I wanted to write a step-by-step walkthrough that covers how to get the Traceur and Babel transpilers working with Gulp (a JavaScript task runner). I’m also going to sneak in a little TypeScript as well since it’s another option. By getting […]


Registering a Custom AngularJS Application with Azure Active Directory

If you’re working with Azure and need to add authentication and identity management into an application look no further than Azure Active Directory (AAD). AAD provides a robust set of services for single sign-on, authentication, multi-factor authentication, and more. Rather than setting up a custom authentication provider for an app, you can leverage existing functionality provided by AAD. To associate a custom application with AAD you first need to register it. If you’ve ever registered a custom app with Facebook, Twitter, or another service you’ll find the AAD app registration process to be quite similar. When you register your application, […]


Building Applications with AngularJS, Azure Active Directory, and Office 365/SharePoint

One of my favorite features of Single Page Applications (SPAs) is the ability to integrate data from nearly any backend technology and have it display on a variety devices (desktop browser, mobile, tablet, and more). Whether you’re calling a service like Firebase or Azure Mobile Services or hitting a custom REST API, the data that’s returned can be integrated into your SPA regardless of the language, technology, or operating system being used on the server. Some of the backend technologies I’ve been spending a lot of time with from a business perspective lately include Azure and the the Office 365/SharePoint […]


Getting Started with ES6 – The Next Version of JavaScript

  JavaScript has come a long ways in its 20 years of existence. It’s grown from a language used to define a few variables and functions to one that can be used to build robust applications on the client-side and server-side. Although it’s popularity continues to grow in large part due to its dynamic nature and ability to run anywhere, JavaScript as a language is still missing many key features that could help increase developer productivity and provide a more maintainable code base. Fortunately, ECMAScript 6 (ES6) adds many new features that will take the language to the next level. […]


My Thoughts on AngularJS 1.3 and 2.0

I’ve received a ton of questions on Twitter and through email about the AngularJS 2.0 announcement. Questions such as “What’s going on with AngularJS?” and “Should I start a new AngularJS 1.3 project when AngularJS 2.0 looks quite different?”. Many people are excited about the modern approach the Angular team is taking with 2.0, a few seem to be predicting doom and gloom, and a few more are worried about what they should do.  As a result of all the questions I decided to put together a quick post since 140 characters on Twitter isn’t really enough. Stay on 1.3 […]


Cancelling Route Navigation in AngularJS

This post has been updated to cover AngularJS 1.3+. Routing provides a nice way to associate views with controllers in AngularJS using a minimal amount of code. While a user is normally able to navigate directly to a specific route, there may be times when a user triggers a route change before they’ve finalized an important action such as saving data.  In this type of situation you may want to cancel the route navigation and ask the user if they’d like to finish what they were doing so that their data isn’t lost. In another situation the user may try […]


What’s “Right” with AngularJS?

There’s been a lot of discussion today on some email groups I’m involved with about a post titled What’s wrong with Angular.js. I’d recommend reading through the post first before continuing but in a nutshell it makes it sound as if AngularJS isn’t a viable framework and should never be used. It also critiques two-way data binding which I found interesting (and misguided). It’s definitely a controversial post with some comments that made me laugh and others that I agreed with completely or in part. I normally ignore these types of posts but in this case I wanted to address […]


Creating Custom AngularJS Directives Part 7 – Creating a Unique Value Directive using $asyncValidators

Creating Custom AngularJS Directives Series In a previous post I demonstrated how to build a unique value directive to ensure that an email address isn’t already in use before allowing a user to save a form. With changes in AngularJS 1.3+, several new features are available to clean up the previous version of the directive and make it easier to work with. In this post I’ll update the previous post, walk-through some of the new features in a directive called wcUnique, and show how a few of the new features can be applied.  The code shown is part of the […]


Learning AngularJS by Example – The Customer Manager Application

Updated: 9/23/2014 I’m always tinkering around with different ideas and toward the beginning of 2013 decided to build a sample application using AngularJS that I call Customer Manager. The goal of the application is to highlight a lot of the different features offered by AngularJS and demonstrate how they can be used together. I also wanted to make sure that the application was approachable by people new to Angular since I’ve never found overly complex applications great for learning new concepts. The application initially started out small and was used in my AngularJS in 60-ish Minutes video on YouTube but […]