// renders the full list of todo items calling TodoView for each one.
app.AppView = Backbone.View.extend({
el: '#todoapp',
initialize: function () {
/*this is where you will add your data to the <script id ></script> template*/
/*this is also where we add all the function we will be using in our app/page */
this.$el this accesses the element itself
this.model this access the data: it could have been a single model:song or a collection model:songs
songView and songsView are both legit views. songview is about a single li when it renders (and what to do with its model data) and songsViews is what to do with each of these songView (using each() function) when it renders
<body>
<!-- Templates -->
<script type="text/template" id="item-template">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.3.3/underscore-min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js" type="text/javascript"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone-localstorage.js/1.0/backbone.localStorage-min.js" type="text/javascript"></script>
<!-- =============== -->
<!-- Javascript code -->
<!-- =============== -->
<script type="text/javascript">
'use strict';
var app = {}; // create namespace for our app
// renders the full list of todo items calling TodoView for each one.
app.AppView = Backbone.View.extend({
el: '#todoapp',
initialize: function () {
this.$el.html("rjeowfjoiewfijoewjeiowwe");
}
});
app.appView = new app.AppView();
</script>
</body>