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
/** | |
* Fake scope object for demo purposes. | |
*/ | |
var myObj = { | |
test : true | |
}; | |
/** | |
* Examples of 'function' invocation with different scope options. | |
*/ |
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
/** | |
* Very simple constructor example. | |
* | |
* Remember the 'constructor' invocation pattern. Constructor invocation is done by using the 'new' keyword | |
* in front of an object. | |
* | |
*/ | |
var MyConstructor = function() { | |
console.log('MyConstructor'); | |
}; |
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
console.clear(); | |
var dest = { | |
foo : { | |
b1 : "b1 value", | |
b2 : "b2 value" | |
}, | |
baz : { | |
q1 : "q1 value" | |
}, |
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
var webpack = require('webpack'); | |
module.exports = { | |
entry: './app/app.js', | |
output: { | |
path: __dirname + '/app', | |
filename: 'app.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
var View = Backbone.View.extend({ | |
template: require('../templates/welcome.html'), | |
render: function() { | |
this.$el.html(this.template({ | |
message: 'Hello There.' | |
})); | |
return this; | |
} |
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
var WelcomeView = require('./scripts/welcome.view.js'), | |
Router; | |
Router = Backbone.Router.extend({ | |
routes: { | |
'': 'home' | |
}, | |
home: function() { |
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
var webpack = require('webpack'); | |
module.exports = { | |
entry: './app/app.js', | |
output: { | |
path: __dirname + '/app', | |
filename: 'app.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
<h1>Welcome!</h1> | |
<p><%= message %></p> |
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
module.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-gh-pages'); | |
grunt.loadNpmTasks('grunt-wintersmith'); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
wintersmith: { | |
build: { | |
options: { | |
config: './config.json' |
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
var Ape = Backbone.Model.extend({ | |
url : 'https://my.restful.api.com/' | |
}); | |
var ApeView = Backbone.View.extend({ | |
template : _.template('A <%= ape.type %> named <%= ape.name %>'), | |
render : function () { | |
this.$el.html(this.template({ | |
ape : this.model.toJSON() |