Angular 2 - No Test Found

angular

Are you trying to run your Angular 2 unit test and the Karma test runner is not finding any tests to execute? This is exactly what happened to me when I tried to run the unit tests that are included as part of the project that the Angular CLI generates. The test runner should have found 3 tests to execute but as your could see above it didn’t find any test to execute.

Read More ›

Angular 2 - Adding Bootstrap Library

angular

Welcome to the continuing series on Getting Started with Angular 2. In the [previous post][], we created our project using the Angular CLI. In this post, we will be adding the Bootstrap library to the project to make it easier to style our application. To make Bootstrap play nice with Angular we are going to use the ng2-bootstrap library which rewrites the Bootstrap components to be powered by Angular instead of JQuery.

Read More ›

Angular 2 - Your First Project

angular

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.

Read More ›

Angular - WTF Module Won’t Route

angular

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.

Read More ›

Calling Filters in Your Angular Controller

angular

Here is a quick tip for how to call a filter from within your Angular controller. This example assumes that you already know what a filter is and have one created. Inject $filter into your controller angular.module('sample').controller('SampleController', SampleController); /* @ngInject */ function SampleController($filter) { } Call your filter by calling: View call your filter called “myFilter” on myDateVariable with arguments arg1 and arg2, you would use: <p>{{myDateVariable | myfilter : arg1 : 'arg2' }}</p> Controller call the same filter from within your controller: function SampleController($filter) { var value = $filter("myFilter")(myDateVariable, arg1, arg2); }

Read More ›

Previous page Next page