Created
September 26, 2014 21:09
-
-
Save topherfangio/ed6e8b235d29ed91c59e to your computer and use it in GitHub Desktop.
Proposed SC.TemplateView Approach
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
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