Writing a unit test for our Angular 2 component.
- [Narrator] Hi and welcome to Section Six…on Maintaining Components.…In this section, we will take a look at some important…aspects that help maintain components like writing out…unit tests as well as techniques for debugging components.…Now, let's move on to the first video of this section.…In this video, we will specifically look at how to write…a proper unit test for Angular2 components.…We will cover Karma, Jasmine and talk about Angular2…specific constructs like inject and injectAsync,…the TestComponentbuilder and ComponentFixture.…So unit testing is an important factor for creating…and maintaining both components and applications.…
Misko, the father of Angular,…has always been a big promoter of testing…which was highly reflected in Angular 1 already.…Same holds for version two.…Okay, let's give it a look.…So we are going to focus on unit testing in this video…and specifically we cover unit testing of components…as that's the core topic of this video series.…So as an example, we will take our modal dialogue…
Get up to speed with one of the most important building blocks of Angular 2: component-based directives, aka components. Components are reusable HTML widgets that replace the controller-based architecture in Angular. This course guides you through the various steps in migrating to Angular 2 and building real-world Angular components of your own.
Author Juri Strumpflohner starts by setting up a modern development environment with TypeScript and ES2015 support. Next, he explains what components are, how to build them, and how they differ from directives. He provides an opportunity to apply these new concepts while building a fictitious dashboard application for a home automation system.
Next, learn about HTML rendering templates, see how to establish a data flow between different components, and even find out how to integrate external libraries. Juri also shows how to make components production-ready and maintainable by applying automated unit and end-to-end testing techniques. As a bonus, discover how to bring your Angular 2 components to other environments such as the server side and mobile devices.
- Upgrading to Angular 2
- Feeding a component with data
- Building a foundation for your Angular app
- Building reusable models
- Comparing components and directives
- Integrating an external library
- Bundling and minification
- Maintaining components
- Testing and debugging Angular 2 components
- Building hybrid mobile apps with Angular 2 and Iconic 2