Created
May 29, 2017 05:44
-
-
Save CheezItMan/8ed47b545c0fc558c9c7a095bab4de17 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| // 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