iStefo / ember-select-2

DEPRECATED IN FAVOR OF https://github.com/cibernox/ember-power-select
MIT License
144 stars 119 forks source link

Ember.String.fmt is deprecated in Ember 2+ #124

Open Kilowhisky opened 9 years ago

Kilowhisky commented 9 years ago

Looks like they have decided to drop it.

https://github.com/emberjs/ember.js/issues/10848

Its used here (https://github.com/iStefo/ember-select-2/blob/9df55428350142de9bb863c625938d43cac86616/addon/components/select-2.js#L249)

    /*
      Format the no matches message, substituting the %@ placeholder with the
      html-escaped user input
     */
    options.formatNoMatches = function(term) {
      var text = self.get('typeaheadNoMatchesText');
      if (text instanceof Ember.Handlebars.SafeString) {
        text = text.string;
      }

      term = Ember.Handlebars.Utils.escapeExpression(term);

      return Ember.String.htmlSafe(Ember.String.fmt(text, term));
    };

And here (https://github.com/iStefo/ember-select-2/blob/9df55428350142de9bb863c625938d43cac86616/addon/components/select-2.js#L259)

 /*
      Format the error message, substituting the %@ placeholder with the promise
      rejection reason
     */
    options.formatAjaxError = function(jqXHR, textStatus, errorThrown) {
      var text = self.get('typeaheadErrorText');

      return Ember.String.htmlSafe(Ember.String.fmt(text, errorThrown));
    };
dzbo commented 8 years ago

+1