Skip to content

Instantly share code, notes, and snippets.

View dalmaer's full-sized avatar

Dion Almaer dalmaer

View GitHub Profile
"packages": {
"web": {
"platforms": [ "web" ],
"combine": false
},
"native-hello-world": {
"platforms": [ "android", "iphone", "ipad" ],
"modules": [ "base", "hello-world" ],
"combine": true
}
"hello-world": {
"routes": {
"": "index",
"hello": "index"
},
"scripts": [
"js/views/hello-world",
"js/routers/hello-world.js"
],
"styles": [
"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"},
Application.Router.create(module, {
index: function() {
var view = this.view('address-form');
view.setModel(addressModel);
this.setView(view);
}
});
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";
});
<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]"/>
Application.Router.create(module, {
index: function() {
var view = this.view('hello-world/index');
this.setView(view);
}
});
<h1>Hello world!</h1>
Application.View.extend({
name: 'hello-world/index'
});
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);
});
});