backbone-super

WebJar for backbone-super

License

License

MIT
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

backbone-super
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

backbone-super
WebJar for backbone-super
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/lukasolson/backbone-super

Download backbone-super

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/backbone-super/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>backbone-super</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/backbone-super/
implementation 'org.webjars.bower:backbone-super:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.bower/backbone-super/
implementation ("org.webjars.bower:backbone-super:1.0.4")
'org.webjars.bower:backbone-super:jar:1.0.4'
<dependency org="org.webjars.bower" name="backbone-super" rev="1.0.4">
  <artifact name="backbone-super" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='backbone-super', version='1.0.4')
)
libraryDependencies += "org.webjars.bower" % "backbone-super" % "1.0.4"
[org.webjars.bower/backbone-super "1.0.4"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bower : backbone jar (0.9,)

Project Modules

There are no modules declared in this project.

Build Status

Backbone-Super

This Backbone.js plugin provides a convenient super method.

Usually, when you're using Backbone.js, you have to do some funky (well, not funky... Javascript-y) stuff to be able to access parent methods.

From the Backbone.js documentation:

Brief aside on super: JavaScript does not provide a simple way to call super — the function of the same name defined higher on the prototype chain. If you override a core function like set, or save, and you want to invoke the parent object's implementation, you'll have to explicitly call it, along these lines:

 
 

var Note = Backbone.Model.extend({ set: function(attributes, options) { Backbone.Model.prototype.set.call(this, attributes, options); ... } });


After including this plugin, you can do the same thing with the following syntax:

```javascript
var Note = Backbone.Model.extend({
	set: function(attributes, options) {
		this._super(attributes, options);
		...
	}
});

To use it, simply include it after you include Backbone.js:

<script type="text/javascript" src="backbone.js"></script>
<script type="text/javascript" src="backbone-super.js"></script>

To use it with Browserify:

var Backbone = require('backbone'),
	Note;

Backbone.$ = require('jquery');
Backbone._ = require('underscore');
require('backbone-super');

Note = Backbone.Model.extend({
	set: function(attributes, options) {
		this._super(attributes, options);
		...
	}
});

module.exports = Note;

License: MIT

Versions

Version
1.0.4