You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -378,13 +378,13 @@ var view = AmpersandView.extend({
378
378
});
379
379
```
380
380
381
-
### queryHook`view.queryHook('hookname')`
381
+
### queryByHook`view.queryByHook('hookname')`
382
382
383
383
A convenience method for retrieving an element from the current view by it's `data-hook` attribute. Using this approach is a nice way to separate javascript view hooks/bindings from class/id selectors that are being used by CSS.
384
384
385
385
notes:
386
-
- It also works if you're using multiple space-separated hooks. So something like `<img data-hook="avatar user-image"/>` would still match for `queryHook('avatar')`.
387
-
- It simply uses `.query()` under the hood. So `.queryHook('avatar')` is equivalent to `.query('[data-hook~=avatar]')`
386
+
- It also works if you're using multiple space-separated hooks. So something like `<img data-hook="avatar user-image"/>` would still match for `queryByHook('avatar')`.
387
+
- It simply uses `.query()` under the hood. So `.queryByHook('avatar')` is equivalent to `.query('[data-hook~=avatar]')`
388
388
- It will also match to root elements.
389
389
- If no match is found it returns `undefined`.
390
390
@@ -395,7 +395,7 @@ var view = AmpersandView.extend({
395
395
this.renderWithTemplate(this);
396
396
397
397
// cache an element for easy reference by other methods
0 commit comments