Home » Posts tagged "angular 2" (Page 2)

Adding Client Side Routing to Angular 2

Over the last several Angular 2 posts, we’ve been building up our application bit by bit and examining the various features of Angular 2 along the way using the Angular CLI where that makes sense and modifying it along the way.  So far, routing is an area that the Angular CLI does not yet support and so, when you want to use routing in your Angular 2 application, you’ll need to wire most of it in by hand.

Now, the routing engine has changed several times during the development of Angular 2.  And I know you’re wondering which version of the router this article is going to be talking about.  So, to be clear, this article was written using the Angular CLI version 1.0.0-beta.21 and Router version 3.2.1.

Adding Client Side Routing to Angular 2
Photo credit: xomiele via Visualhunt / CC BY

Continue reading “Adding Client Side Routing to Angular 2”

Unit Testing an Angular 2 CLI Project

This week we want to continue our series about Angular 2 by looking at the Unit Testing capabilities that Angular 2 provides for us.  What we want to cover today is:

  • Tweaking Karma to avoid using the Browser Window
  • Code Coverage
  • Tips to testing components

This article was written using Angular CLI version 1.0.0-beta.20-4  (Tip, if you are upgrading on windows, rm –rf node_modules dist temp just means to delete the three directories.  You can do that part manually, or install bash for Windows and run the command in bash.)

Unit Testing an Angular 2 CLI Project
Photo credit: jimmiehomeschoolmom via VisualHunt.com / CC BY-NC-SA

Continue reading “Unit Testing an Angular 2 CLI Project”

Getting Started with Angular 2

Angular 2 is finally released.  But the biggest problem with learning Angular 2 is that it is a “Choose your own adventure” kind of framework.  And while React has a similar problem, I think Angular has out done them.  This means that you can learn bits and pieces of Angular 2, but it will be a while before you get a cohesive understanding of what choices you need to make, which choices are the right choices, and why all of this matters.

And all of this is even more difficult if you are a relatively new programmer.  I’m talking those of you who have less than 5 years of experience and even some of you who have less than 10 years of experience.

So, what I thought I’d do to address this very real problem is to assemble a very opinionated Angular 2 tutorial.  Over the next several weeks I plan to show you how to create a simple CRUD application using Angular 2 in a way that will scale up to larger projects.  While I may mention some of the other options along the way, what you’ll end up with is the “right way.”  OK.  To be fair, most of what I consider “right” is opinion.  Some very smart people disagree with me.  But, some other very smart people agree with me too.

Getting Started with Angular 2
Photo credit: mikecogh via VisualHunt / CC BY-SA

Continue reading “Getting Started with Angular 2”