El source code explica de la siguiente manera:
/**
Returns a jQuery object for this view's element. If you pass in a selector
string, this method will return a jQuery object, using the current element
as its buffer.
For example, calling `view.$('li')` will return a jQuery object containing
all of the `li` elements inside the DOM element of this view.
@param {String} [selector] a jQuery-compatible selector string
@returns {Ember.CoreQuery} the CoreQuery object for the DOM node
*/
$: function(sel) {
return this.invokeForState('$', sel);
},
Así que para responder a su pregunta: no, no es lo mismo que $(this)
, que envuelva la instancia de vista brasa en un objeto jQuery ...
El primer fragmento sugiere que el objeto jQuery ($) se almacena como una propiedad en 'this', posiblemente para evitar la contaminación del alcance global, pero no estoy seguro. –
Pero está ejecutado. Y vuelve, así que está encadenado. Creo que eso es legítimo, pero nunca hubiera pensado en intentar eso ... – jcolebrand
hace esto. Button() funciona? Si es así, 'esto' es un objeto jquery. – MMeah