Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jessica and Gale - Carets #3

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Added image tag to result list
vertige committed Dec 19, 2017
commit 48e47519c89ec8be161c8ddff3239c4f664fa8f7
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ <h3>RENTAL LIBRARY</h3>
</script>

<script type="text/template" id="result-list-template">
<%- title %>
<img src="<%- image_url %>" /><%- title %>
</script>

<!-- INCLUDES -->
15 changes: 15 additions & 0 deletions src/views/result_view.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import Backbone from 'backbone';

const ResultView = Backbone.View.extend({
initialize(params) {
this.template = params.template;
this.model = params.model;
},
render() {
const compiledTemplate = this.template(this.model.toJSON());
this.$el.html(compiledTemplate);
return this;
},
});

export default ResultView;