Skip to content

Commit 1ef8835

Browse files
committed
fix: linting and aot errors
1 parent 4aa1ae1 commit 1ef8835

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

src/demo-app/style/style-demo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Renderer} from '@angular/core';
1+
import {Component, Renderer2} from '@angular/core';
22
import {FocusOriginMonitor} from '@angular/material';
33

44

@@ -9,5 +9,5 @@ import {FocusOriginMonitor} from '@angular/material';
99
styleUrls: ['style-demo.css'],
1010
})
1111
export class StyleDemo {
12-
constructor(public renderer: Renderer, public fom: FocusOriginMonitor) {}
12+
constructor(public renderer: Renderer2, public fom: FocusOriginMonitor) {}
1313
}

src/lib/button-toggle/button-toggle.spec.ts

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -259,28 +259,29 @@ describe('MdButtonToggle', () => {
259259
expect(groupInstance.selected.value).toBe(groupInstance.value);
260260
});
261261

262-
it('should have the correct FormControl state initially and after interaction', fakeAsync(() => {
263-
expect(groupNgModel.valid).toBe(true);
264-
expect(groupNgModel.pristine).toBe(true);
265-
expect(groupNgModel.touched).toBe(false);
266-
267-
buttonToggleInstances[1].checked = true;
268-
fixture.detectChanges();
269-
tick();
270-
271-
expect(groupNgModel.valid).toBe(true);
272-
expect(groupNgModel.pristine).toBe(false);
273-
expect(groupNgModel.touched).toBe(false);
274-
275-
let nativeRadioLabel = buttonToggleDebugElements[2].query(By.css('label')).nativeElement;
276-
nativeRadioLabel.click();
277-
fixture.detectChanges();
278-
tick();
279-
280-
expect(groupNgModel.valid).toBe(true);
281-
expect(groupNgModel.pristine).toBe(false);
282-
expect(groupNgModel.touched).toBe(true);
283-
}));
262+
it('should have the correct FormControl state initially and after interaction',
263+
fakeAsync(() => {
264+
expect(groupNgModel.valid).toBe(true);
265+
expect(groupNgModel.pristine).toBe(true);
266+
expect(groupNgModel.touched).toBe(false);
267+
268+
buttonToggleInstances[1].checked = true;
269+
fixture.detectChanges();
270+
tick();
271+
272+
expect(groupNgModel.valid).toBe(true);
273+
expect(groupNgModel.pristine).toBe(false);
274+
expect(groupNgModel.touched).toBe(false);
275+
276+
let nativeRadioLabel = buttonToggleDebugElements[2].query(By.css('label')).nativeElement;
277+
nativeRadioLabel.click();
278+
fixture.detectChanges();
279+
tick();
280+
281+
expect(groupNgModel.valid).toBe(true);
282+
expect(groupNgModel.pristine).toBe(false);
283+
expect(groupNgModel.touched).toBe(true);
284+
}));
284285

285286
it('should update the ngModel value when selecting a button toggle', fakeAsync(() => {
286287
buttonToggleInstances[1].checked = true;
@@ -341,7 +342,8 @@ describe('MdButtonToggle', () => {
341342
let fixture = TestBed.createComponent(ButtonToggleGroupWithInitialValue);
342343
let testComponent = fixture.debugElement.componentInstance;
343344
let groupDebugElement = fixture.debugElement.query(By.directive(MdButtonToggleGroup));
344-
let groupInstance: MdButtonToggleGroup = groupDebugElement.injector.get<MdButtonToggleGroup>(MdButtonToggleGroup);
345+
let groupInstance: MdButtonToggleGroup = groupDebugElement.injector
346+
.get<MdButtonToggleGroup>(MdButtonToggleGroup);
345347

346348
fixture.detectChanges();
347349

src/lib/core/style/focus-origin-monitor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ export class FocusOriginMonitor {
6363
* @returns An observable that emits when the focus state of the element changes.
6464
* When the element is blurred, null will be emitted.
6565
*/
66-
monitor(element: HTMLElement, renderer: Renderer2, checkChildren: boolean): Observable<FocusOrigin> {
66+
monitor(element: HTMLElement, renderer: Renderer2, checkChildren: boolean):
67+
Observable<FocusOrigin> {
68+
6769
// Check if we're already monitoring this element.
6870
if (this._elementInfo.has(element)) {
6971
let info = this._elementInfo.get(element);
@@ -169,9 +171,9 @@ export class FocusOriginMonitor {
169171
*/
170172
private _setClasses(element: HTMLElement, origin: FocusOrigin): void {
171173
let renderer = this._elementInfo.get(element).renderer;
172-
let toggleClass = (_class: string, shouldSet: boolean) => {
173-
shouldSet ? renderer.addClass(element, _class) : renderer.removeClass(element, _class);
174-
}
174+
let toggleClass = (className: string, shouldSet: boolean) => {
175+
shouldSet ? renderer.addClass(element, className) : renderer.removeClass(element, className);
176+
};
175177

176178
toggleClass('cdk-focused', !!origin);
177179
toggleClass('cdk-touch-focused', origin === 'touch');

0 commit comments

Comments
 (0)