Skip to content

Commit

Permalink
Merge pull request #15897 from romulomachado/remove-link-to-deprecation
Browse files Browse the repository at this point in the history
[CLEANUP] Remove controller wrapped param deprecation
  • Loading branch information
rwjblue authored Dec 1, 2017
2 parents 1723b73 + 52a057f commit b4614b7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
11 changes: 0 additions & 11 deletions packages/ember-glimmer/lib/components/link-to.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,17 +774,6 @@ const LinkComponent = EmberComponent.extend({
for (let i = 0; i < modelCount; i++) {
let value = params[i + 1];

while (ControllerMixin.detect(value)) {
deprecate(
'Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated. ' +
(this.parentView ? 'Please update `' + this.parentView +
'` to use `{{link-to "post" someController.model}}` instead.' : ''),
false,
{ id: 'ember-routing-views.controller-wrapped-param', until: '3.0.0' },
);
value = value.get('model');
}

models[i] = value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,6 @@ moduleFor('Link-to component', class extends ApplicationTest {
});
}

['@test unwraps controllers']() {
this.router.map(function() {
this.route('profile', { path: '/profile/:id' });
});
this.addTemplate('application', `{{#link-to 'profile' otherController}}Text{{/link-to}}`);
this.add('controller:application', Controller.extend({
otherController: Controller.create({
model: 'foo'
})
}));

let deprecation = /Providing `{{link-to}}` with a param that is wrapped in a controller is deprecated./;

return this.visitWithDeprecation('/', deprecation).then(() => {
this.assertText('Text');
});
}

['@test able to safely extend the built-in component and use the normal path']() {
this.addComponent('custom-link-to', { ComponentClass: LinkComponent.extend() });
this.addTemplate('application', `{{#custom-link-to 'index'}}{{title}}{{/custom-link-to}}`);
Expand Down

0 comments on commit b4614b7

Please sign in to comment.