Ember.js - Return unicode character from computed property

后端 未结 1 1043
执念已碎
执念已碎 2021-01-23 15:53

I\'m trying to return a unicode character from a computed property, but the & keeps getting escaped as &.

I\'ve even tried returni

相关标签:
1条回答
  • 2021-01-23 16:22

    I just created a simple jsbin: http://jsbin.com/izurix/5/edit

    Basically doing this does not return any &amp 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.

    0 讨论(0)
提交回复
热议问题