问题
I'm trying to return a unicode character from a computed property, but the & keeps getting escaped as &.
I've even tried returning a Handlebars SafeString like so:
return new Ember.Handlebars.SafeString("");
...which produces the same results: 
How can I get this working?
Edit: This is probably related to the fact that I'm using the computed property in the valueBinding of an {{input}} helper. The SafeString method does keep the & from being escaped if I use the value elsewhere.
回答1:
I just created a simple jsbin: http://jsbin.com/izurix/5/edit
Basically doing this does not return any & for me:
App.ApplicationController = Ember.ObjectController.extend({
value: "",
someValue: function() {
return new Handlebars.SafeString(this.get('value'));
}.property('value')
});
Furthermore if you don't want that handlebars escapes your string you should use triple-slash {{{someValue}}}.
Hope it helps.
来源:https://stackoverflow.com/questions/18189097/ember-js-return-unicode-character-from-computed-property