Sunday, 15 January 2012

ember.js - {{content-for 'head'}} Ember-cli -



ember.js - {{content-for 'head'}} Ember-cli -

i've been using yeoman ember generator past 1 month , now, i'd give ember-cli try. i'm sorry if question seem extremely newbie, i'm desperately need explanation.

i run generator , launch app, works fine.

ember new my-new-app ember server

but i'd know how

{{content-for 'head'}}

in app/index.html works?

when looking @ other examples http://www.ember-cli.com/#tutorials, none of them using particular helper? because using older version of ember-cli? why weren't using content-for helper?

i'm pretty sure ember.js doesn't have content-for helper in default, i'm guessing ember-cli wrote somewhere? , for?

also, when inspect element of my-new-app page, div tag of 'welcome ember.js' appeared @ body tag instead of head tag? how possible? {{mind-blown}}

( in app/index.html, {{content-for 'head'}} placed within head tag)

thank much help.

it added ember-cli based on this discussion.

here relevant code commit:

emberapp.prototype.contentfor = function(config, match, type) { var content = []; if (type === 'head') { content.push(calculatebasetag(config)); content.push('<meta name="' + config.moduleprefix + '/config/environment" ' + 'content="' + escape(json.stringify(config)) + '">'); } content = this.project.addons.reduce(function(content, addon) { if (addon.contentfor) { homecoming content.concat(addon.contentfor(type, config)); } homecoming content; }, content); homecoming content.join('\n'); };

ember.js ember-cli

No comments:

Post a Comment