Reputation: 411
Tom Dayle's Lecture: Intro to Ember
http://www.youtube.com/watch?feature=player_embedded&v=Ga99hMi7wfY
i used both github.com/cmoel/tom_dale_ember_screencast
github.com/cmoel/tom_dale_ember_screencast And
github.com/jielimanyili/tom-dale-screencast_building-an-app-with-ember-js_code
In Chrome Dev:
Uncaught TypeError: Cannot call method 'replace' of undefined (showdown.js:62)
If i remove the use of "markdown" from the template.. the App works.
In FireBug: a is undefined (showdown.js: 62)
Not sure if it is Ember or Showdown that is causing this.
Thanks
Upvotes: 0
Views: 2384
Reputation: 543
I too followed Tom Dale's youtube video and seemed to get this error only when I refresh the page while on the #/posts/1 (posts/post route).
I managed to resolve this issue by skipping the showdown conversion in the registerBoundHelper, like so:
var showdown = new Showdown.converter();
Ember.Handlebars.registerBoundHelper('markdown', function(input) {
// Add this part
if (typeof input == 'undefined') return;
return new Ember.Handlebars.SafeString(showdown.makeHtml(input));
});
Upvotes: 1
Reputation: 12011
I think you will be...little angry... this was just a typo I think... in the template you refer {{extended}}
, but in the fixtures, the property is extentded
. So obviously the Showdown plugin complains because you're trying to use it with undefined.
http://jsfiddle.net/Sly7/7vfLD/7/
Upvotes: 0