As I get more into Angular 2 I wanted to figure out how to unit test my Angular components. Angular 2 has unit testing built-in to the project that the Angular CLI generates. It uses Karma for the test runner and Jasmine for the testing. The Angular docs also have a really good Testing Guide.
When I tried to run the built-in test instead of finding the 3 tests, it found 0 tests. Never having used Karma before, I was unsure what the issue was or where to start troubleshooting. Luckily it turned out to be a really simple fix once I figured it out and it had to do with Chrome v55 not running the test.ts file.
Welcome to the series on Getting Started with Angular 2. Angular 2 was released in September 2016 and and so far I have been enjoying working with it. I have been using the TypeScript version of Angular 2. It is has been pretty easy for me so far to pick it up but there have been a few things that have made me scratch me head. In this series I am going to walk you through creating a simple Angular 2 project that has a header/footer, routing to components/modules, show how to add new components/services, create multiple modules, lock down routes, changing UI configurations based on the environment parameter and adding in the Bootstrap library. When you are done with the series, you will have a good structure for any project that you want to start.
In this post we will get everything setup on your machine to do Angular 2 developer and then you will create your Angular 2 project that the rest of the series will build on. We will be using the new Angular CLI to generate the project and several of the features such as components, services, modules, and pipes.
I have been really enjoying working with Angular 2 over the last few months but the other day I spent well over an hour cursing Angular wondering why my new module would not route. I didn’t have this much trouble when I created my other modules a few weeks before. However, this time when I navigated to my new module route it kept going to my catch all route.
I verified that I had spelled everything correctly in the routing configuration and in the browser url. I verified that I had imported the new module in the app module. I swore everything was setup correctly. WTF. What was going on? What did I miss.
Find out how simple the solution is.
In order to work with the Ionic framework there is a bit of software installs and configuration that needs to happen in order to deploy to devices. However, many of the guides out there leave out a number of steps that tripped me up when I first started using Ionic.
This guide will go through all of the steps needed for deploying to an Android and iOS device using a Mac.