Brad Collins
1 min readNov 3, 2017

--

How does one access Ember.Handlebars.Utils.escapeExpression using the new import syntax? If I use the example code from the Ember docs (https://guides.emberjs.com/v2.16.0/templates/writing-helpers/#toc_escaping-html-content) …

import { helper } from "@ember/component/helper";
import Handlebars from "handlebars";
import { htmlSafe } from "@ember/component";

export function makeBold([param, ...rest]) {
let value = Handlebars.Utils.escapeExpression(param);
return htmlSafe(`<b>${value}</b>`);
});

export default helper(makeBold);

… I get the following error:

Could not find module `handlebars`

--

--