docs: more overview feedback changes (#25663)

PR Close #25663
This commit is contained in:
Brandon Roberts
2018-09-19 14:15:49 -05:00
committed by Kara Erickson
parent bd42caf1c7
commit 9b14483824
5 changed files with 25 additions and 34 deletions

View File

@ -34,13 +34,13 @@ describe('Favorite Color Component', () => {
input.value = 'Red';
input.dispatchEvent(event);
expect(fixture.componentInstance.favoriteColor.value).toEqual('Red');
expect(fixture.componentInstance.favoriteColorControl.value).toEqual('Red');
});
// #enddocregion view-to-model
// #docregion model-to-view
it('should update the value in the control', () => {
component.favoriteColor.setValue('Blue');
component.favoriteColorControl.setValue('Blue');
const input = fixture.nativeElement.querySelector('input');

View File

@ -1,19 +1,13 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
@Component({
selector: 'app-reactive-favorite-color',
template: `
Favorite Color: <input type="text" [formControl]="favoriteColor">
Favorite Color: <input type="text" [formControl]="favoriteColorControl">
`,
styles: []
})
export class FavoriteColorComponent implements OnInit {
favoriteColor = new FormControl('');
constructor() { }
ngOnInit() {
}
export class FavoriteColorComponent {
favoriteColorControl = new FormControl('');
}

View File

@ -48,7 +48,7 @@ describe('FavoriteColorComponent', () => {
input.value = 'Red';
input.dispatchEvent(event);
tick();
fixture.detectChanges();
expect(component.favoriteColor).toEqual('Red');
}));

View File

@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
@Component({
selector: 'app-template-favorite-color',
@ -7,12 +7,6 @@ import { Component, OnInit } from '@angular/core';
`,
styles: []
})
export class FavoriteColorComponent implements OnInit {
export class FavoriteColorComponent {
favoriteColor = '';
constructor() { }
ngOnInit() {
}
}