docs: document MdInput focus() method (#1486)

This commit is contained in:
Philippe MARTIN
2016-10-17 12:50:39 +02:00
committed by Jeremy Elbourn
parent e4af65afc9
commit 3bb667e907
+18
View File
@@ -86,7 +86,25 @@ The divider (line under the `<md-input>` content) color can be changed by using
You can label the `<md-input>` as you would a regular `<input>`.
## Focus
You can put the focus on an input component using the `focus()` method.
### Example
```html
<md-input #nameInput placeholder="name"></md-input>
```
```ts
export class MyComponent implements OnInit {
@ViewChild('nameInput') nameInput: MdInput;
ngOnInit() {
this.nameInput.focus();
}
}
```
## Full Forms