Skip to content

Commit

Permalink
Fix linters
Browse files Browse the repository at this point in the history
  • Loading branch information
devversion committed Aug 30, 2016
1 parent c06604f commit 3474fed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/demo-app/slide-toggle/slide-toggle-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {Component} from '@angular/core';
export class SlideToggleDemo {

onFormSubmit() {
alert(`You submitted the form.`)
alert(`You submitted the form.`);
}

}
11 changes: 5 additions & 6 deletions src/lib/slide-toggle/slide-toggle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,22 +378,20 @@ describe('MdSlideToggle', () => {

it('should prevent the form from submit when being required', async(() => {

let fixture = TestBed.createComponent(SlideToggleFormsTestApp);

fixture.detectChanges();

buttonElement.click();
expect(testComponent.isSubmitted).toBe(false);

// Make the form valid by setting the slide-toggle to true.
labelElement.click();
testComponent.isChecked = true;
fixture.detectChanges();

buttonElement.click();
expect(testComponent.isSubmitted).toBe(true);
}));

})
});

});

Expand Down Expand Up @@ -450,10 +448,11 @@ class SlideToggleTestApp {
selector: 'slide-toggle-forms-test-app',
template: `
<form (ngSubmit)="isSubmitted = true">
<md-slide-toggle name="slideToggle" ngModel required>Required</md-slide-toggle>
<md-slide-toggle name="slideToggle" [(ngModel)]="isChecked" required>Required</md-slide-toggle>
<button type="submit"></button>
</form>`
})
class SlideToggleFormsTestApp {
isSubmitted: boolean = false;
}
isChecked: boolean = false;
}

0 comments on commit 3474fed

Please sign in to comment.