Monthly Archives: October 2013

Handlebars #each in a Play Scala View

If you’re using Play Scala views with Handlebars in them, and you get errors that look like these: not found: value key In /home/phil/myproject/app/views/myview.scala.html at line 108. or not found: value index In /home/phil/myproject/app/views/myview.scala.html at line 108. It’s probably because you’re using {{@index}} when iterating through an array with {{#each myarray}} or {{@key}} when iterating […]

Open a folder window from a cmd prompt in Windows

Easy way to open up a folder window while in a command line prompt. This opens a window to wherever you are, in case. C:>mkdir tempdir C:>cd tempdir C:tempdir>explorer . C:tempdir>

Using a Backbone Model with Handlebars

A Backbone model’s property has to be accessed with the get(property) method. var myObj = Backbone.Model.extend({ … }); //don’t do this console.log(myObj.myProp); //do this instead console.log(myObj.get(‘myProp’)); If you’re trying to pass this object to a Handlebars.js, things start to get messy. If you’ve got a template like this var myTemplate = Handlebars.compile(“Property: {{ myObj.myProp }}”); […]