diff --git a/src/components/button/button.ts b/src/components/button/button.ts index 3a0a6fb1c8fe..a9d7caadfef0 100644 --- a/src/components/button/button.ts +++ b/src/components/button/button.ts @@ -80,6 +80,11 @@ export class MdButton { removeKeyboardFocus() { this.isKeyboardFocused = false; } + + /** TODO(hansl): e2e test this function. */ + focus() { + this.elementRef.nativeElement.focus(); + } } @Component({ diff --git a/src/demo-app/button/button-demo.html b/src/demo-app/button/button-demo.html index 3b4d4beeffa3..dab30c8c4bca 100644 --- a/src/demo-app/button/button-demo.html +++ b/src/demo-app/button/button-demo.html @@ -63,11 +63,14 @@
isDisabled: {{isDisabled}}, clickCounter: {{clickCounter}}
+ + +