Skip to content

Instantly share code, notes, and snippets.

View marvinosswald's full-sized avatar

Marvin Oßwald marvinosswald

View GitHub Profile
import Ember from "ember";
export default Ember.Component.extend({
attributeBindings: ['id'],
id: 'calendar',
setEvents:function (){
console.log(this.get("theEvents"));
}.observes("theEvents"),
_initializeCalendar: function() {
var self = this;
@marvinosswald
marvinosswald / gist:6d11c40fc1ae1e194d58
Created April 15, 2015 12:45
How to access a model assigned by the controller from an action
import Ember from "ember";
export default Ember.Route.extend({
setupController:function(controller){
if(sessionStorage.user){
var user = JSON.parse(sessionStorage.user);
if(!user){
this.transitionTo('login');
}else{
//way to go
@marvinosswald
marvinosswald / admin-modal
Created April 14, 2015 13:38
Can't access inputTitle from "submit" action
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{title}}</h4>
</div>
<div class="modal-body">
{{yield}}
</div>
<div class="modal-footer">
@marvinosswald
marvinosswald / index.html
Created August 12, 2014 12:59
Emberjs nested child view example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Ember Starter Kit</title>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/normalize/2.1.0/normalize.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v1.3.0.js"></script>
<script src="http://builds.emberjs.com/tags/v1.5.1/ember.min.js"></script>
<style id="jsbin-css">