Skip to content

Commit

Permalink
Merge pull request #11787 from martndemus/deprecate-slash-namespace
Browse files Browse the repository at this point in the history
[BUGFIX release] Deprecate slash for a namespace in the {{render}} helper
  • Loading branch information
rwjblue committed Jul 17, 2015
2 parents 513494f + 3c81def commit 080cb36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/ember-routing-htmlbars/lib/keywords/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export default {
}

// # legacy namespace
let originalName = name;
name = name.replace(/\//g, '.');
Ember.deprecate(`Using a slash for namespacing with the {{render}} render helper has been deprecated.
Please replace "${originalName}" with "${name}" in your call to the {{render}} helper.`, !originalName.match(/\//g));
// \ legacy slash as namespace support

var templateName = 'template:' + name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ QUnit.test('{{render}} works with slash notation', function() {

Ember.TEMPLATES['blog.post'] = compile('{{uniqueId}}');

runAppend(view);
expectDeprecation(() => { runAppend(view); }, /Using a slash for namespacing/);

var singletonController = container.lookup('controller:blog.post');
equal(singletonController.uniqueId, view.$().html(), 'rendered with correct singleton controller');
Expand Down

0 comments on commit 080cb36

Please sign in to comment.