Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/x-handlebars" data-template-name="gigs">
- <div> // code simplified
- {{#each controller itemController="gig"}}
- {{#view App.GigView contentBinding="this"}}
- <div class="tile">
- <img {{bindAttr src="photo_url"}} />
- {{#if widgetDisplayed}}
- // widget view
- {{/if}}
- </div>
- {{/view}}
- {{/each}}
- </div>
- </script>
- App.GigsController = Ember.ArrayController.extend({
- anyWidgetDisplayed: false,
- isAnyWidgetDisplayed: function() {
- return anyWidgetDisplayed;
- }
- });
- App.GigController = Ember.ObjectController.extend({
- needs: ["gigs"],
- widgetDisplayed: false,
- displayWidget: function() {
- console.log(controllers.gigs);
- if (!controllers.gigs.isAnyWidgetDisplayed) {
- this.set("widgetDisplayed", true);
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement