Created
September 15, 2015 16:37
-
-
Save dariushoule/c1b730b541157d7be5ab to your computer and use it in GitHub Desktop.
Ember obj example
This file contains hidden or 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
// --- Controller | |
App.ApolloExampleController = Ember.ObjectController.extend({ | |
exampleRender: [] | |
}); | |
// --- Helper, example of something that could happen on click | |
viewCtx.controller.set('exampleRender', [ | |
{"a": "this is a1!", "b": "this is b1!"}, | |
{"a": "this is a2!", "b": "this is b2!"} | |
]); | |
$('#myModal').modal('show'); | |
// --- HBS | |
<div class="container"> | |
<div class="modal fade" id="myModal" role="dialog"> | |
<div class="modal-dialog"> | |
<div class="modal-content"> | |
<div class="modal-header"> | |
<button type="button" class="close" data-dismiss="modal">×</button> | |
<h4 style="color:red;"><span class="glyphicon glyphicon-lock"></span> Example</h4> | |
</div> | |
<div class="modal-body"> | |
{{#each item in exampleRender}} | |
{{item.a}} | {{item.b}}<br/> | |
{{else}} | |
No Items | |
{{/each}} | |
</div> | |
<div class="modal-footer"> | |
<button type="submit" class="btn btn-default btn-default pull-left" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span> OK</button> | |
</div> | |
</div> | |
</div> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment