我正在尝试解决一个Angular 表单验证 动手,为此我制作了以下表单,该表单通过了除一个之外的所有测试用例,看起来问题出在测试文件(app.component.spec.ts)上动手操作的只读 工作演示将表单状态显示为VALID。但它没有通过测试
过去两天我一直坚持使用这种手工表格。衷心感谢您的帮助。
-----------[只读]app.component.spec.ts---------
import { AppComponent } from './app.component';
import { ReactiveFormsModule, FormControl, AbstractControl, FormGroup } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { asNativeElements, DebugElement } from '@angular/core';
describe('AppComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ReactiveFormsModule],
declarations: [AppComponent]
})
.compileComponents();
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
}));
// it('should create the component', () => {
// expect(component).toBeTruthy();
// …Run Code Online (Sandbox Code Playgroud) 我制作了一个活动跟踪器,该活动跟踪器在单击添加活动时添加活动,而在单击清除所有按钮时删除所有活动,并显示带有复选框的活动列表。现在,我想要的是应用文本装饰:行直通,并在单击特定活动的复选框时将活动文本的颜色更改为红色。这是我正在尝试做的工作演示和图片。我尝试了几种方法来执行此操作,但我猜会有一些使用ngClass指令(但我没有找到实现方法的方法)的快速而聪明的方法。因此,我期望一个聪明的方法不会经典而冗长。