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
"packages": { | |
"web": { | |
"platforms": [ "web" ], | |
"combine": false | |
}, | |
"native-hello-world": { | |
"platforms": [ "android", "iphone", "ipad" ], | |
"modules": [ "base", "hello-world" ], | |
"combine": true | |
} |
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
"hello-world": { | |
"routes": { | |
"": "index", | |
"hello": "index" | |
}, | |
"scripts": [ | |
"js/views/hello-world", | |
"js/routers/hello-world.js" | |
], | |
"styles": [ |
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
"base": { | |
"scripts": [ | |
{"src": "js/lib/zepto.js", "global": true}, | |
{"src": "js/lib/underscore.js", "global": true}, | |
{"src": "js/lib/backbone.js", "global": true}, | |
{"src": "js/lib/handlebars.js", "global": true}, | |
{"src": "js/lib/thorax.js", "global": true}, | |
{"src": "js/lib/script.js", "global": true}, | |
{"src": "js/lib/lumbar-loader.js", "platform": "web"}, | |
{"src": "js/lib/lumbar-loader-standard.js", "platform": "web"}, |
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
Application.Router.create(module, { | |
index: function() { | |
var view = this.view('address-form'); | |
view.setModel(addressModel); | |
this.setView(view); | |
} | |
}); |
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
Phoenix.View.extend({ | |
name: "address-form", | |
events: { | |
"submit form": "_handleSubmit" | |
}, | |
_handleSubmit: function(event) { | |
this.serialize(event, function(attributes) { | |
attributes["last-name"] === "Beastridge"; | |
attributes.address.street === "123 Chestnut"; | |
}); |
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
<label for="{{cid}}-last-name"/> | |
<input name="last-name" id="{{cid}}-last-name" value="Beastridge"/> | |
<label for="{{cid}}-last-name"/> | |
<input name="address[street]" value="123 Chestnut" id="{{cid}}-address[street]"/> |
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
Application.Router.create(module, { | |
index: function() { | |
var view = this.view('hello-world/index'); | |
this.setView(view); | |
} | |
}); |
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
Application.View.extend({ | |
name: 'hello-world/index' | |
}); |
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
describe('test suite', function () { | |
it('should expose a function', function () { | |
expect(add).to.be.a('function'); | |
}); | |
it('should do math', function () { | |
expect(add(1, 3)).to.equal(4); | |
}); | |
}); |