Skip to content

docs: Document MdInput focus() method #1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 17, 2016
Merged

Conversation

feloy
Copy link
Contributor

@feloy feloy commented Oct 12, 2016

Document the MdInput focus() method

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 12, 2016
@feloy feloy changed the title Md input focus Document MdInput focus() method Oct 12, 2016
@feloy feloy changed the title Document MdInput focus() method docs: Document MdInput focus() method Oct 12, 2016
@fxck
Copy link
Contributor

fxck commented Oct 13, 2016

I think really think this belongs to the docs, it's a workaround for a missing feature(autofocus)..

### Example

```html
<md-input #nameInput placeholder="name"></md-input>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The #nameInput isn't necessary in this example because you're using @ViewChild with the class. I'd omit it so that people don't mistakenly get the impression that a @ViewChild name has to match some template variable name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I used the ViewChild incorrectly. What I wanted to write was instead:
@ViewChild('nameInput') nameInput: MdInput;
to that this sample still works when multiple md-input are present in the template.
Do you agree?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that works too.

@jelbourn jelbourn merged commit 3bb667e into angular:master Oct 17, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants