Skip to content

Instantly share code, notes, and snippets.

@CheezItMan
Created May 29, 2017 05:44
Show Gist options
  • Select an option

  • Save CheezItMan/8ed47b545c0fc558c9c7a095bab4de17 to your computer and use it in GitHub Desktop.

Select an option

Save CheezItMan/8ed47b545c0fc558c9c7a095bab4de17 to your computer and use it in GitHub Desktop.
import _ from 'underscore';
import $ from 'jquery';
import 'jquery-colpick';
import Postit from './models/postit.js';
var postitData = [{
text: "Backbone is a library not a Framework.",
color: "#AC1200"
},
{
text: "That means it doesn't dictate to you how the code is structured",
color: "#752310"
}];
var myPostit = new Postit({
text: "This is a postit!",
color: "#752310"
});
$(document).ready(function() {
console.log("Lets go!");
var template = $("#postit-template");
var templateObject = _.template(template.html());
var compiledTemplate = templateObject(myPostit.toJSON());
$('#postits').append(compiledTemplate);
});
// end
// postit.js
import Backbone from 'backbone';
const Postit = Backbone.Model.extend({ });
export default Postit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment