pruno-cli
Version:
A CLI tool for scaffolding projects that use the pruno build tool and a generator for creating components.
30 lines (24 loc) • 542 B
JavaScript
import {View} from "backbone";
import router from "../routers/AppRouter";
export default View.extend({
el: '#route-handler',
template: require('../hbs/about.hbs'),
initialize() {
this.listenTo(router, 'route', this.route.bind(this));
},
route(route) {
if (route === 'about') {
this.render();
this.delegateEvents();
}
else {
this.undelegateEvents();
}
},
render() {
var ctx = this.model.toJSON();
var html = this.template(ctx);
this.$el.html(html);
return this;
}
});