Skip to content

Commit 16df824

Browse files
committed
chore: many typos
1 parent 5c6b0a4 commit 16df824

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

src/lib/core/error/error-options.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ import {FormGroupDirective, NgForm, NgControl} from '@angular/forms';
1212
/** Error state matcher that matches when a control is invalid and dirty. */
1313
@Injectable()
1414
export class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher {
15-
isErrorSate(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
15+
isErrorState(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
1616
return control ? !!(control.invalid && (control.dirty || (form && form.submitted))) : false;
1717
}
1818
}
1919

2020
/** Provider that defines how form controls behave with regards to displaying error messages. */
2121
@Injectable()
2222
export class ErrorStateMatcher {
23-
isErrorSate(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
23+
isErrorState(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
2424
return control ? !!(control.invalid && (control.touched || (form && form.submitted))) : false;
2525
}
2626
}

src/lib/input/input-container.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ describe('MdInputContainer with forms', () => {
843843
MdInputContainerWithFormErrorMessages
844844
],
845845
providers: [
846-
{ provide: ErrorStateMatcher, useValue: { isErrorSate: globalErrorStateMatcher } }
846+
{ provide: ErrorStateMatcher, useValue: { isErrorState: globalErrorStateMatcher } }
847847
]
848848
});
849849

@@ -1201,7 +1201,7 @@ class MdInputContainerWithCustomErrorStateMatcher {
12011201

12021202
errorState = false;
12031203
customErrorStateMatcher: ErrorStateMatcher = {
1204-
isErrorSate: () => this.errorState
1204+
isErrorState: () => this.errorState
12051205
};
12061206
}
12071207

src/lib/input/input-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ export class MdInputDirective implements OnChanges, OnDestroy, DoCheck {
296296
private _updateErrorState() {
297297
let oldState = this._isErrorState;
298298
let matcher = this.errorStateMatcher || this._globalErrorStateMatcher;
299-
let newState = matcher.isErrorSate(this._ngControl, this._parentFormGroup || this._parentForm);
299+
let newState = matcher.isErrorState(this._ngControl, this._parentFormGroup || this._parentForm);
300300

301301
if (newState !== oldState) {
302302
this._isErrorState = newState;

src/lib/input/input.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ By default, error messages are shown when the control is invalid and either the
115115
with (touched) the element or the parent form has been submitted. If you wish to override this
116116
behavior (e.g. to show the error as soon as the invalid control is dirty or when a parent form group
117117
is invalid), you can use the `errorStateMatcher` property of the `mdInput`. To use this property,
118-
create an `ErrorStateMatcher` object in your component class that has a `isErrorSate` function which
118+
create an `ErrorStateMatcher` object in your component class that has a `isErrorState` function which
119119
returns a boolean. A result of `true` will display the error messages.
120120

121121
```html
@@ -127,7 +127,7 @@ returns a boolean. A result of `true` will display the error messages.
127127

128128
```ts
129129
class MyErrorStateMatcher implements ErrorStateMatcher {
130-
isErrorSate(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
130+
isErrorState(control: NgControl | null, form: FormGroupDirective | NgForm | null): boolean {
131131
// Error when invalid control is dirty, touched, or submitted
132132
const isSubmitted = form && form.submitted;
133133
return !!(control && control.invalid && (control.dirty || control.touched || isSubmitted)));

src/lib/select/select.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2674,7 +2674,7 @@ describe('MdSelect', () => {
26742674
expect(component.control.invalid).toBe(false);
26752675
expect(component.select._isErrorState()).toBe(false);
26762676

2677-
customErrorFixture.componentInstance.errorStateMatcher = { isErrorSate: matcher };
2677+
customErrorFixture.componentInstance.errorStateMatcher = { isErrorState: matcher };
26782678
customErrorFixture.detectChanges();
26792679

26802680
expect(component.select._isErrorState()).toBe(true);
@@ -2683,7 +2683,7 @@ describe('MdSelect', () => {
26832683

26842684
it('should be able to override the error matching behavior via the injection token', () => {
26852685
const errorStateMatcher: ErrorStateMatcher = {
2686-
isErrorSate: jasmine.createSpy('error state matcher').and.returnValue(true)
2686+
isErrorState: jasmine.createSpy('error state matcher').and.returnValue(true)
26872687
};
26882688

26892689
fixture.destroy();
@@ -2700,7 +2700,7 @@ describe('MdSelect', () => {
27002700
errorFixture.detectChanges();
27012701

27022702
expect(component.select._isErrorState()).toBe(true);
2703-
expect(errorStateMatcher.isErrorSate).toHaveBeenCalled();
2703+
expect(errorStateMatcher.isErrorState).toHaveBeenCalled();
27042704
});
27052705
});
27062706

src/lib/select/select.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
638638
/** Whether the select is in an error state. */
639639
_isErrorState(): boolean {
640640
const matcher = this.errorStateMatcher || this._globalErrorStateMatcher;
641-
return matcher.isErrorSate(this._control, this._parentFormGroup || this._parentForm);
641+
return matcher.isErrorState(this._control, this._parentFormGroup || this._parentForm);
642642
}
643643

644644
/**

0 commit comments

Comments
 (0)