I've been injecting Google DFP ads in my blog-posts by using a bound helper so far. Since all Handlebars APIs have been removed in Ember 2.0 what can I use as of Ember 2.0 instead?
import Ember from "ember";
export default Ember.Handlebars.makeBoundHelper(function(value, options) {
var parsedHtml = Ember.$('<div />').html(value)
// Push the ads after the divs have been rendered
Ember.run.schedule('afterRender', function() {
googletag.cmd.push(function() { googletag.display('div-gpt-ad-111111111-0'); });
})
}
return parsedHtml.html()
});
You would use the Ember.Helper.helper syntax:
Params is an array of all the values that you pass to the helper in your template such as
{{my-helper val1 val2 val3}}
params[0]
isval1
and so on, the hash is an object containing all the properties you set on the helper{{my-helper val1 val2 property1=myPropValue}}
and you would access it viahash.property1
.