Skip to content

Instantly share code, notes, and snippets.

@topherfangio
Created September 26, 2014 21:09
Show Gist options
  • Save topherfangio/ed6e8b235d29ed91c59e to your computer and use it in GitHub Desktop.
Save topherfangio/ed6e8b235d29ed91c59e to your computer and use it in GitHub Desktop.
Proposed SC.TemplateView Approach
MyApp.MyView = SC.EasySimpleTemplateView.extend({
template: [
"<div class='background' style='position: absolute; top: 0px; left: 0px; width: {{layout.width}}px; height: {{layout.height}}px'></div>",
"<div style='position: absolute; top: 0px; left: 0px; width: {{layout.width}}px; height: {{layout.height}}px'>",
" <div class='title'>{{title}}</div>",
" <img class='icon' src='{{icon}}' />",
" <div class='description'>{{description}}</div>",
"</div>",
(p.new_count > 0 ? "<div class='badge' style='position: absolute; top: 5px; right: 5px;'>{{new_count}}</div>"
].join("\n")
// OR, we could point to a template URL that has this
templateUrl: "/templates/my_awesome_view.html"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment