Skip to content

Commit

Permalink
refactor(docs-infra): remove outdated comments regarding CustomEvent (#…
Browse files Browse the repository at this point in the history
…44557)

remove the comments present in aio examples saying that for older
browsers such as IE CustomEvent could be necessary (as the the Event
constructor could be not available)

such comments are no longer necessary/relevant since the Event constructor
is available for all the supported browsers

PR Close #44557
  • Loading branch information
dario-piotrowicz authored and dylhunn committed Feb 3, 2022
1 parent 5fdd8ae commit b9aee90
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 16 deletions.
Expand Up @@ -288,8 +288,6 @@ describe('demo (with TestBed):', () => {

// Dispatch a DOM event so that Angular learns of input value change.
// then wait while ngModel pushes input.box value to comp.name
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
input.dispatchEvent(new Event('input'));
return fixture.whenStable();
})
Expand Down Expand Up @@ -332,8 +330,6 @@ describe('demo (with TestBed):', () => {

// Dispatch a DOM event so that Angular learns of input value change.
// then wait a tick while ngModel pushes input.box value to comp.name
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
input.dispatchEvent(new Event('input'));
tick();
expect(comp.name)
Expand All @@ -358,8 +354,6 @@ describe('demo (with TestBed):', () => {
// Dispatch a DOM event so that Angular learns of input value change.
// then wait a tick while ngModel pushes input.box value to comp.text
// and Angular updates the output span
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
input.dispatchEvent(new Event('input'));
tick();
fixture.detectChanges();
Expand Down
Expand Up @@ -102,8 +102,6 @@ function overrideSetup() {

page.nameInput.value = newName;

// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
page.nameInput.dispatchEvent(new Event('input')); // tell Angular

expect(component.hero.name)
Expand Down Expand Up @@ -223,8 +221,6 @@ function heroModuleSetup() {
nameInput.value = 'quick BROWN fOx';

// Dispatch a DOM event so that Angular learns of input value change.
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
nameInput.dispatchEvent(new Event('input'));

// Tell Angular to update the display binding through the title pipe
Expand Down
Expand Up @@ -58,8 +58,6 @@ describe('HeroListComponent', () => {
const expectedHero = HEROES[1];
const btn = page.heroRows[1].querySelector('button');

// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
btn!.dispatchEvent(new Event('click'));
tick();
// `.toEqual` because selectedHero is clone of expectedHero; see FakeHeroService
Expand All @@ -70,8 +68,6 @@ describe('HeroListComponent', () => {
const expectedHero = HEROES[1];
const btn = page.heroRows[1].querySelector('button');

// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
btn!.dispatchEvent(new Event('click'));
tick();

Expand Down
Expand Up @@ -63,8 +63,6 @@ describe('HighlightDirective', () => {
input.value = 'green';

// Dispatch a DOM event so that Angular responds to the input value change.
// In older browsers, such as IE, you might need a CustomEvent instead. See
// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
input.dispatchEvent(new Event('input'));
fixture.detectChanges();

Expand Down

0 comments on commit b9aee90

Please sign in to comment.