I am reading a book http://www.meteor-tutorial.org/book/1_1_first_app and could not understand some code from it mentioned below.
"Another thing we should do is avoid global jQuery selectors such as $(’input[name=name]’).val(). The issue with this is that our template should only be able to manipulate elements inside of our template. If there happens to be another input[name=name] element on the page we might accidentally use that value instead of the one we were after.
To fix this we can change the scope of the jQuery call by using the second parameter of the event function - the parameter I named tpl, which stands for template and is an instance of the template object. It has a function called $, which reduces the scope of the jQuery selector down to just the template.
Hence we can update our code to:... 'submit form.create-team': function(e, tpl){ e.preventDefault(); var teamName = tpl.$('input[name=name]').val(); Teams.insert({name: teamName}); } ...
"
I do not get this that tpl thing that how this is instance of template object and how they can used its as to reduce the scope ?
**var teamName = tpl.$('input[name=name]').val();**