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
var rr = new RouteRecognizer | |
//this is currently used | |
rr.add([ | |
{path: "whatever", handler: whateverHandler} | |
]); | |
//when recognize is run, it will return this | |
[{handler: whateverHandler, params: {}}] |
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
var routeManaged = false; | |
var HashRoutePlugin = { | |
getCurrentRoute: function() { | |
return window.location.hash; | |
}, | |
pushCurrentRoute: function(newRoute) { | |
window.location.hash = newRoute; | |
}, | |
setCurrentRoute: function(newRoute) { |
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
/** | |
first arg is a function, second is the number of arguments | |
to expect before executing | |
(N.B. The second arg is optional and will default to the arity | |
of the function if not provided) | |
*/ | |
function curry (fn, numArgs) { | |
var numArgs = numArgs || fn.length; | |
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
<div class="row"> | |
<ol class="breadcrumb"> | |
<li>{{#link-to "videos"}}Videos{{/link-to}}</li> | |
</ol> | |
</div> | |
<div class="media"> | |
<div class="media-header"> | |
<h3>{{title}}</h3> | |
<h4>{{description}}</h4> | |
<h5>Published on: {{publication_date}}</h5> |
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
model: function (params) { | |
var FetchPromise = Ember.RSVP.Promise(function (resolve, reject) { | |
Ember.RSVP.hash({ | |
dinosaurs: App.Dinosaur.find(), | |
ninjas: App.Ninja.find() | |
}) | |
.then(function (objects) { | |
resolve(objects); | |
}) |
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
wrapWithProperty = (arrayName, propertyName, value) -> | |
Ember.computed arrayName + ".[]", -> | |
@get(arrayName).map( (each) -> | |
eachHash = {} | |
eachHash[propertyName] = value | |
eachHash.content = each | |
Ember.ObjectProxy.create(eachHash) | |
) | |
wrapWithHash = (arrayName, hashName) -> |
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
AR.AgentrunPickadateComponent = Ember.Component.extend | |
events: [ | |
'onOpen', | |
'onClose', | |
'onRender', | |
'onStart', | |
'onStop', | |
'onSet' | |
] |
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
#original attribution https://gist.github.com/alexspeller/6251054 | |
bound = (fnName) -> Ember.computed fnName -> @get(fnName).bind(@) | |
App.ClickElsewhereMixin = Ember.Mixin.create | |
#use this method hook to define your desired behavior | |
onClickElsewhere: Ember.K | |
#bound version of our instance method |
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
##Hey | |
here is some normal text |
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
<script type="text/x-handlebars"> | |
<h1>Dashboard</h1> | |
{{outlet cats}} | |
{{outlet dogs}} | |
</script> | |
<script type="text/x-handlebars" data-template-name="cats"> | |
{{#each cat in controller.content}} | |
{{cat}} |