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

Use template.find().value #182

Open
SachaG opened this issue Dec 1, 2014 · 2 comments
Open

Use template.find().value #182

SachaG opened this issue Dec 1, 2014 · 2 comments

Comments

@SachaG
Copy link
Member

SachaG commented Dec 1, 2014

Cross-posted from #349:


May i suggest to use "template.find().value" to retrieve elements?

For example on page 123 (book version 1.6) the code can be rewritten such as:

jquery

$(e.target).find('[name=url]').val()

Meteor style

template.find('#url').value

It is the Meteor style and also ensures that a null value is returned instead of undefined.

@tmeasday
Copy link
Member

tmeasday commented Dec 1, 2014

Yeah, we should do this.

@webyak
Copy link

webyak commented Feb 13, 2015

Just wanted to leave a Disqus comment before I saw this. Why not don't you use e.target.url.value? Clean and simple if there's a name attribute.

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

No branches or pull requests

3 participants