Posts

Showing posts from 2017

Finally... Package.json.js

Image
I know I have been promising to finish looking at the default files created Angular CLI for over a week now and finally we get there. Granted this isn't the most exciting subject but when we start coding in the next post, you will need to know about these files. So let's take a look at the package.json.js file. The file itself breaks down into three sections; Settings, Dependencies and DevDependencies. Let's do a quick review of each section. Settings There are a couple things you want to look at in the Settings section. First are the name, version and author properties. These are pretty obvious but I still wanted to draw your attention to them since a lot of folks leave them at the default. Take a few moments and update these. Next lets look at the start property, by default it is set to "ng serve" but if you want to run your Angular 2 app locally, you will need to change this. Angular has no concept of localhost so you need to modify this to add ...

Angular 4; is it fantastic?

Image
The good folks at Google unleashed Angular 4 or just Angular, a week ago. Let's take a look at some of the features that are new in Angular 4. In fact let's look at four of them. First, if you are curious, Google decided to skip Angular 3 and go straight to 4. Which is fine by me because I would have probably had to use a graphic of the band Rush to represent Angular 3 and no one wants that. Here are some of the features that I have taken advantage of: TypeScript 2.1 Angular 4 now supports TypeScript 2.1 which is cool but I was kinda hoping it would support TypeScript 2.2. It is my understanding that if you are using Yarn instead of the Node Package Manager, Angular 4 with 2.2 will give you fits. But we do get some cool features in TypeScript 2.1 things like async/await and also Object Rest & Spread which helps with copying and merging, a la the Redux library. You can read all the updates in TypeScript 2.1  Here  . Animations In Angular 4, animations have ...

Angular 2 vs ReactJS

Image
Last post I promised you a look at the default package.json file that is created by the Angular CLI but I thought I would pivot and share some events that have happened to me recently. As you may know, I have been looking for a new gig. One of the questions that I have gotten consistently is "What is the difference between Angular 2 and ReactJS?" I usually answer one was created by Google and one was created by Facebook. We all have a good laugh and then they say "Seriously, what is the difference?"  So let's go over how I answer this. First, let me give a couple of disclosures here. First; I don't claim to be an expert in either system and second; I have written about 5 times more Angular 1/Angular 2 code than I have React, so my natural leanings are toward Angular. I will try to keep this fair and biased though. Similarities First let's look how Angular and React are similar. First they are both a subset of JavaScript, which should strike f...

Angular CLI pt2: tsconfig.json.js

Image
Yeah, I get it, configuration files aren't exactly sexy but they are pretty handy if you need to add a third party package, change the target format for your TypeScript files or change the compiler for just in time to ahead of time. If you followed my last blog post, you now have a shiny new Angular 2 project. Lets take a look at the configuration files that the CLI gives us by default. So let's take a look at the TypeScript configuration file. tsconfig.json.js This is the configuration file for the TypeScript Compiler (TSC) . If you are not familiar with TypeScript, I highly recommend Dan Wahlin & Joe Papa's PluralSight course : TypeScript Fundamentals. A quick definition of TypeScript would be "a JavaScript format that allows a developer to write object oriented code". If you hate writing JavaScript that sounds awesome, right? The only problem is that it is written in a version of ECMAScript (es2016) that is not supported yet by modern browsers so it ...

Using the Angular CLI to set up an Angular 2 project

Image
Angular 2 is a powerful javascript framework and you can do some amazing things with it. It is better optimized and responsive than Angularjs 1.X. So now you are all ready to go. All ready to dive feet first into Angular 2 but here is the challenge, where do you start? Angular 2 has a more in depth project set up than Angularjs 1. You can't just load a few libraries and go. Fear not, there are several ways to kick start your first project. You can search GitHub and find some start up projects, check out the starter files by Deborah Kurata, or you can use the Angular CLI to generate your start up project. So let's walk through using the CLI. Prerequisites Before we start using the Angular 2 CLI, you must have Node.JS and the Node Package Manage. You don't have them installed, you can go to https://www.npmjs.com/ and download it. Angular CLI  This will allow you to run the Angular 2 CLI and import and unpack the packages. Next, go to https://cli.angu...