I’m trying to get Ember running with BPM based on these instructions:
https://github.com/bpm/bpm/wiki/Using-BPM-with-SproutCore-2.0
Everything seems to work fine until I try to add an expression to the Handlebars template:
Congratulations! You are running HelloWorld v{{MyApp.VERSION}}
Then I get the following error:
TypeError: 'undefined' is not a function (evaluating 'a.charAt(0)')
If I remove the expression, everything works fine.
The source is here: https://github.com/nicholasjhenry/bpm_ember
Can anyone provide determine why this error is occurring?
Edit: The line that is throwing the error is:
function normalizePath(path) {
ember_assert('must pass non-empty string to normalizePath()', path && path!=='');
if (path==='*') return path; //special case...
var first = path.charAt(0); // <======
which is called by Ember.watch.
EDIT (2012/01/03)
I have updated the packages on GetBPM.org so now they work out of the box. All you have to do is run
bpm add emberin your project directory and everything will work fine. I also have updated using BPM with Ember.js instructions here: https://github.com/ud3323/bpm/wiki/Using-BPM-with-Ember.