-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Many great changes for a new release
- Loading branch information
1 parent
0712bb3
commit b9c295d
Showing
10 changed files
with
320 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "bindr", | ||
"version": "0.0.1", | ||
"version": "0.2.0", | ||
"main": [ | ||
"./dist/bindr.js", | ||
"./dist/bindr.min.js" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
function Model() { | ||
bindr(this, arguments); | ||
function Car(engine, dashboard) { | ||
this.engine = engine; | ||
this.dashboard = dashboard; | ||
} | ||
|
||
function Car(make, model, color, service) { | ||
this.make = make; | ||
this.model = model; | ||
this.color = color; | ||
this.service = service; | ||
|
||
bindr(this, arguments); | ||
function Engine() {} | ||
|
||
function Dashboard(ac, radio) { | ||
this.ac = ac; | ||
this.radio = radio; | ||
} | ||
|
||
function Ac () {} | ||
function Radio (stereo, cd) { | ||
this.stereo = stereo; | ||
this.cd = cd; | ||
} | ||
|
||
function Service() {} | ||
function FakeService() {} | ||
function Stereo() {} | ||
function Cd() {} | ||
|
||
Car = bindr(Car, ['engine', 'dashboard']); | ||
Dashboard = bindr(Dashboard, ['ac', 'radio']); | ||
Radio = bindr(Radio, ['stereo', 'cd']); | ||
|
||
bindr.bind('service', FakeService); | ||
bindr.bind({ | ||
"engine": Engine, | ||
"dashboard": Dashboard, | ||
"ac": Ac, | ||
"radio": Radio, | ||
"stereo": Stereo, | ||
"cd": Cd | ||
}); | ||
|
||
var ford = new Car('Ford', 'Fusion', 'Maroon'); | ||
var ford = new Car(); | ||
|
||
document.getElementById('car').innerHTML = JSON.stringify(ford, null, 4); | ||
document.getElementById('car').innerHTML = JSON.stringify(ford, null, 4); |
Oops, something went wrong.