Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ampersand-view

Package Overview
Dependencies
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-view - npm Package Compare versions

Comparing version 6.0.8 to 6.0.9

2

ampersand-view.js

@@ -252,3 +252,3 @@ var State = require('ampersand-state');

var opts = {
selector: subview.container || '[role=' + subview.role + ']',
selector: subview.container || '[role="' + subview.role + '"]',
waitFor: subview.waitFor || '',

@@ -255,0 +255,0 @@ prepareView: subview.prepareView || function (el) {

{
"name": "ampersand-view",
"description": "A smart base view for Backbone apps, to make it easy to bind collections and properties to the DOM.",
"version": "6.0.8",
"version": "6.0.9",
"author": "Henrik Joreteg <henrik@andyet.net>",

@@ -6,0 +6,0 @@ "browser": "./ampersand-view.js",

@@ -76,5 +76,5 @@ # ampersand-view

The `.autoRender` property lets you optionally specify that the view should just automatically render with all the defaults. This requires that you at minimum specify a [template](#template) string of function.
The `.autoRender` property lets you optionally specify that the view should just automatically render with all the defaults. This requires that you at minimum specify a [template](#template) string or function.
By setting `autoRender: true` the view will simply call `.renderWithTemplate` for you (after your `initialize` method if present). So for simple views, if you've got a few bindings and a template your whole view could just be really and declarative like this:
By setting `autoRender: true` the view will simply call `.renderWithTemplate` for you (after your `initialize` method if present). So for simple views, if you've got a few bindings and a template your whole view could just be really declarative like this:

@@ -221,3 +221,3 @@ ```javascript

* Attaches the following options directly to the instaniated view, overriding the defaults: `model`, `collection`, `el`.
* Attaches the following options directly to the instantiated view, overriding the defaults: `model`, `collection`, `el`.
* Sets up event bindings defined in the `events` hash.

@@ -461,3 +461,3 @@ * Sets up the model bindings defined in the `bindings` hash.

You can declare subviews that you want to render within a view, much like you would bindings. Useful for cases where the data you need for a subview may not be available on first render. Also, simplifies cases wehre you have lots of subviews.
You can declare subviews that you want to render within a view, much like you would bindings. Useful for cases where the data you need for a subview may not be available on first render. Also, simplifies cases where you have lots of subviews.

@@ -464,0 +464,0 @@ When the parent view is removed the `remove` method of all subviews will be called as well.

@@ -554,2 +554,24 @@ var test = require('tape');

test('subview role can include special characters', function (t) {
var Sub = AmpersandView.extend({
template: '<span></span>'
});
var View = AmpersandView.extend({
template: '<div><div role="test.hi-there"></div></div>',
autoRender: true,
subviews: {
sub1: {
role: 'test.hi-there',
constructor: Sub
}
}
});
var view = new View();
t.equal(view.el.innerHTML, '<span></span>');
t.end();
});
test('make sure subviews dont fire until their `waitFor` is done', function (t) {

@@ -556,0 +578,0 @@ var Sub = AmpersandView.extend({

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc