Hi
We have an angular 1 component library, which we're trying to adapt to ng2,
using the UpgradeAdapter. So as per the docs, the ng1 directives need to
follow a certain set of rules
https://angular.io/docs/ts/latest/guide/upgrade.html#!#using-component-directives
So we converted one of our directives to the structure as advised on the
link above, but the problem is while using it in a sample ng2 application,
it is not able to know of a change which happened. Ideally the lifecycle
method $onChanges should get called with the changes object. But except for
$onInit, none of the lifecycle method is being called.
I also had a quick look in the UpgradeAdapter code and it does not seem to
be even calling the $onChanges method. Here's the UpgradeAdapter code:
UpgradeNg1ComponentAdapter.prototype.ngOnChanges = function(changes) {
for (var name in changes) {
if (changes.hasOwnProperty(name)) {
var change = changes[name];
this.setComponentProperty(name, change.currentValue); // With this
the property does get updated, but the ng1 component does not get to know, that
a change has happened, so it cannot react to it.
}
}
};
Has anyone come across this issue and has been able to solve it ?
Appreciate the help.
Thanks
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.