July 2017
Intermediate to advanced
454 pages
10h 1m
English
In our preceding example, we have seen a basic example of writing a test script and testing Angular components.
In this section, we will explore writing best practices for testing Angular components. We will use the same component we created in the preceding section--TestAppComponent--and expand the test suite more by adding variables and methods.
In the test-app.component.ts file, let's create a few variables and map them into the view:
import { Component, OnInit } from '@angular/core';@Component({ selector: 'app-test-app', templateUrl: './test-app.component.html', styleUrls: ['./test-app.component.css']})export class TestAppComponent implements OnInit { public authorName = 'Sridhar';}
Let's analyze ...
Read now
Unlock full access