forked from cujojs/wire
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major refactoring of object creation and initialization using an init…
… queue. Better reference resolution. Experimental rest plugin that can resolve references to rest resources
- Loading branch information
1 parent
a1dac98
commit 55bc3c8
Showing
10 changed files
with
320 additions
and
141 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,22 @@ | |||
<!DOCTYPE HTML> | |||
<html lang="en-US"> | |||
<head> | |||
<meta charset="UTF-8"> | |||
<title>Launcher test</title> | |||
<script type="text/javascript"> | |||
djConfig = { | |||
baseUrl: './', | |||
modulePaths: { | |||
'dojo': 'dojo', | |||
'dijit': 'dijit', | |||
'test': 'test' | |||
} | |||
}; | |||
</script> | |||
<script src="require.js" type="text/javascript" charset="utf-8"></script> | |||
<script type="text/javascript" src="wire.js" data-wire-spec="rest1.js"></script> | |||
</head> | |||
<body> | |||
|
|||
</body> | |||
</html> |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
wire({ | |||
wire$plugins: [ | |||
{ module: 'wire/rest' } | |||
], | |||
controller: { | |||
module: 'test/rest1/Controller', | |||
create: [], | |||
properties: { | |||
store: { '$ref': 'rest!test/rest1/person.json' } | |||
}, | |||
init: 'ready' | |||
}, | |||
controller2: { | |||
module: 'test/rest1/Controller', | |||
create: [], | |||
properties: { | |||
store: { | |||
module: 'dojo/store/JsonRest', | |||
create: [{ target: 'test/rest1/person.json' }] | |||
} | |||
}, | |||
init: 'ready' | |||
} | |||
}, | |||
function(context) { | |||
console.log(context.get('controller')); | |||
console.log(context.get('controller2')); | |||
}); |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,13 @@ | |||
define([], function() { | |||
|
|||
var Controller = function() { | |||
}; | |||
|
|||
Controller.prototype.ready = function() { | |||
this.store.query({}).forEach(function(person) { | |||
console.log(person); | |||
}); | |||
}; | |||
|
|||
return Controller; | |||
}); |
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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,10 @@ | |||
[ | |||
{ | |||
"id": 1, | |||
"name": "Sergei Rachmaninoff" | |||
}, | |||
{ | |||
"id": 2, | |||
"name": "Dmitri Bortnianski" | |||
} | |||
] |
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
Oops, something went wrong.