Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Current to Part 7 of the blog series - http://brianmajewski.com/2015/…
- Loading branch information
Showing
10 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
define(function (require) { | |||
|
|||
'use strict'; | |||
var Backbone = require('backbone'); | |||
var Model = require('users/model'); | |||
|
|||
return Backbone.Collection.extend({ | |||
model: Model, | |||
url: '/api/users' | |||
}); | |||
}); |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
<div class="well"> | |||
<h4><b>Users</b></h4> | |||
</div> | |||
<table class="table table-bordered table-striped"> | |||
<thead> | |||
<th>ID</th> | |||
<th>Email</th> | |||
<th>Name</th> | |||
</thead> | |||
<tbody> | |||
{{#each users}} | |||
<tr> | |||
<td>{{_id}}</td> | |||
<td>{{email}}</td> | |||
<td>{{name}}</td> | |||
</tr> | |||
{{/each}} | |||
</tbody> | |||
</table> |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
define(function (require) { | |||
|
|||
'use strict'; | |||
var Backbone = require('backbone'); | |||
var template = require('hbs!users/list'); | |||
require('datatables'); | |||
require('datatables-bootstrap3'); | |||
|
|||
return Backbone.View.extend({ | |||
el: '#content', | |||
render: function(){ | |||
this.$el.html(template({users: this.collection.toJSON()})); | |||
this.$('table').DataTable(); | |||
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
define(function (require) { | |||
|
|||
'use strict'; | |||
var Backbone = require('backbone'); | |||
|
|||
return Backbone.Model.extend({ | |||
idAttribute: '_id', | |||
urlRoot: '/api/users' | |||
}); | |||
|
|||
}); |
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
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