Skip to content

Commit 32e5de8

Browse files
committed
chore: many typos
1 parent 9200c6f commit 32e5de8

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
@@ -896,7 +896,7 @@ describe('MdInputContainer with forms', () => {
896896
MdInputContainerWithFormErrorMessages
897897
],
898898
providers: [
899-
{ provide: ErrorStateMatcher, useValue: { isErrorSate: globalErrorStateMatcher } }
899+
{ provide: ErrorStateMatcher, useValue: { isErrorState: globalErrorStateMatcher } }
900900
]
901901
});
902902

@@ -1254,7 +1254,7 @@ class MdInputContainerWithCustomErrorStateMatcher {
12541254

12551255
errorState = false;
12561256
customErrorStateMatcher: ErrorStateMatcher = {
1257-
isErrorSate: () => this.errorState
1257+
isErrorState: () => this.errorState
12581258
};
12591259
}
12601260

src/lib/input/input-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export class MdInputDirective implements OnChanges, OnDestroy, DoCheck {
301301
private _updateErrorState() {
302302
let oldState = this._isErrorState;
303303
let matcher = this.errorStateMatcher || this._globalErrorStateMatcher;
304-
let newState = matcher.isErrorSate(this._ngControl, this._parentFormGroup || this._parentForm);
304+
let newState = matcher.isErrorState(this._ngControl, this._parentFormGroup || this._parentForm);
305305

306306
if (newState !== oldState) {
307307
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
@@ -2689,7 +2689,7 @@ describe('MdSelect', () => {
26892689
expect(component.control.invalid).toBe(false);
26902690
expect(component.select._isErrorState()).toBe(false);
26912691

2692-
customErrorFixture.componentInstance.errorStateMatcher = { isErrorSate: matcher };
2692+
customErrorFixture.componentInstance.errorStateMatcher = { isErrorState: matcher };
26932693
customErrorFixture.detectChanges();
26942694

26952695
expect(component.select._isErrorState()).toBe(true);
@@ -2698,7 +2698,7 @@ describe('MdSelect', () => {
26982698

26992699
it('should be able to override the error matching behavior via the injection token', () => {
27002700
const errorStateMatcher: ErrorStateMatcher = {
2701-
isErrorSate: jasmine.createSpy('error state matcher').and.returnValue(true)
2701+
isErrorState: jasmine.createSpy('error state matcher').and.returnValue(true)
27022702
};
27032703

27042704
fixture.destroy();
@@ -2715,7 +2715,7 @@ describe('MdSelect', () => {
27152715
errorFixture.detectChanges();
27162716

27172717
expect(component.select._isErrorState()).toBe(true);
2718-
expect(errorStateMatcher.isErrorSate).toHaveBeenCalled();
2718+
expect(errorStateMatcher.isErrorState).toHaveBeenCalled();
27192719
});
27202720
});
27212721

src/lib/select/select.ts

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

645645
/**

0 commit comments

Comments
 (0)