feat(upgrade): fix support for directive.link in upgraded components

(#17971)

Although, pre- and post-linking functions are correctly called during directive
linking, directives with `link.post` would throw an error. Interestingly, having
`link.pre` only or defining `link: fn` (which is an alias for `link.post: fn`)
would not throw.

This commit removes this check and allows directives with pre- and/or
post-linking functions to work.
This commit is contained in:
Georgios Kalpakas
2017-05-29 20:52:50 +03:00
committed by Jason Aden
parent 2ea73513ea
commit 0193be7c9b
2 changed files with 238 additions and 6 deletions

View File

@ -90,12 +90,6 @@ export class UpgradeHelper {
if (directive.terminal) this.notSupported('terminal');
if (directive.compile) this.notSupported('compile');
const link = directive.link;
// QUESTION: why not support link.post?
if (typeof link == 'object') {
if (link.post) this.notSupported('link.post');
}
return directive;
}