Skip to content
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

Angular如何获取dom节点 #85

Open
deepthan opened this issue Aug 13, 2020 · 0 comments
Open

Angular如何获取dom节点 #85

deepthan opened this issue Aug 13, 2020 · 0 comments

Comments

@deepthan
Copy link
Owner

引用dom节点 -- #refName

<input #user type='text'>
<button (click)='onClick(user.value)' ></button>

我们在input标签里面加了一个#user,这个叫做引用。
它引用的是input对象,那么我们用#user.value则获取到了input里面的值。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant