From 3bb667e9073851a53df352794ca43634e718043c Mon Sep 17 00:00:00 2001 From: Philippe MARTIN Date: Mon, 17 Oct 2016 12:50:39 +0200 Subject: [PATCH] docs: document MdInput focus() method (#1486) --- src/lib/input/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib/input/README.md b/src/lib/input/README.md index 38a5482869d..81eaa2dbf22 100644 --- a/src/lib/input/README.md +++ b/src/lib/input/README.md @@ -86,7 +86,25 @@ The divider (line under the `` content) color can be changed by using You can label the `` as you would a regular ``. +## Focus +You can put the focus on an input component using the `focus()` method. + +### Example + +```html + +``` + +```ts +export class MyComponent implements OnInit { + @ViewChild('nameInput') nameInput: MdInput; + + ngOnInit() { + this.nameInput.focus(); + } +} +``` ## Full Forms