Talent Shortage with JavaScript Frameworks

Talent Shortage with JavaScript Frameworks

According to a report from HackerRank the widest skill gap with IT talent plays out in JavaScript frameworks, particularly with React. More and more employers are seeking developers proficient in the framework, but the talent isn’t readily available just yet.

It should also be noted that AngularJS and Node.js are more heavily favored by developers. Spring and Django seem to gaining popularity with employers and developers alike but not quite as much as React. Visit HackerRank for the full breakdown.

Testing Angular Services

Rick HerrmannUntil recently, the front-end testing I’d done had not directly tested any Angular services. In almost every case, the $http calls in the services were just returning data from an API back to a controller. However, on a recent project I had a scenario where the data from the API had to have some filtering and permission logic applied before passing on the data. This was a case where unit testing the service made sense.

As it turns out, testing a service is very similar to testing a controller in terms of setting up the test, injecting dependencies, and making assertions. The only real difference is the need to mock the $http call in the service. To do this the angular-mocks library provides the $httpBackend tool. Let’s walk through an example of testing a service.

Continue reading “Testing Angular Services”

Angular.js – Testing Directives

Rick HerrmannOne of the features of Angular is that it was built with testability in mind.  The separation of the DOM layer, controllers, and services, as well as the use of dependency injection make it relatively easy to develop testable code.

I am very familiar with the practice of writing unit tests and have been testing C# code for several years.  Although I did find testing in Angular to be a little confusing at first, once I got used to the code required to set-up the tests – it was pretty easy.

Continue reading “Angular.js – Testing Directives”

Learning Angular.js

misc4_bgOver the past few months I have been working with Angular a lot.  I had no previous knowledge of Angular before this.  The Pluralsight course that helped me out the most was AngularJS: Get Started by Scott Allen.  It was very easy to follow along.  Scott was very good at explaining what he was doing.

One other resource that I found was very helpful was a walkthrough on scotchio.  This was good to go through after watching the training video.  This walkthrough actually showed how to set up a simple project.  It didn’t have as much explanation involved but it was a good walkthrough of exactly how to get a sample project set up and was a good starting point for creating a project to play around with.

Continue reading “Learning Angular.js”

ES6 -Working with Objects

Rick HerrmannWant to work with the Nerdia team? Submit your resume.

Today we are looking at several new ES6 features that make working with objects easier.

Object.assign

The new assign function is used to copy all of the properties from one (or more) object(s) to another object.  I have used this feature many times before in other libraries (jquery, underscore, lodash, angular) – always in the form of an extend function.  The syntax looks like the following, where all of the properties in the source objects are copied to the target object:

Continue reading “ES6 -Working with Objects”

ES6 – Getting Started

Rick HerrmannES6, or as it is now being called js2015, is the first update to javascript since 2009.  The ES6 spec had been in the works for a while and was finalized in June of 2015.  The new features that have been added are significant and will change the way developers work with the language.  However, because the major browsers do not yet fully support ES6, using ES6 directly in the browser today is not realistic.

But there is a way you CAN start using ES6 on the web today and that is by converting it (transpiling) to ES5.  There are a number of transpilers available today but the most popular right now are Babel and Traceur.  These tools let you use the new syntax and features of ES6 but have your code converted to ES5 – which runs everywhere.

So let’s take a look at what is new in javascript 2015.

A complete list of all of the new ES6 features is beyond the scope of this article, so I’ll cover a few of the things that are easy to get started with.

Continue reading “ES6 – Getting Started”