Closed DcsMarcRemolt closed 8 years ago
Thanks.
I think ngOnViewInit and ngOnDestroy are both in the right place, but I wonder about ngOnInit. Per this doc: https://angular.io/docs/ts/latest/api/core/OnInit-interface.html, it says:
Implement this interface to execute custom initialization logic after your directive's data-bound properties have been initialized.
But due to bug #81, I'm not 100% sure that data-bound properties (aka Inputs) will be ready by the time this hook is called. It might. I would need you to check in both TypeScript and Babel compilers.
So to get this merged:
Otherwise I do plan to work on this story when I get back into things. So maybe another month tops if you leave it to us.
I think I'm going to pick this up. I'll certainly use what you've got here, but I'll take care to add the other required stuff (tests, docs) as well as maybe do onChange as well.
Added those three lifecycle hooks. Only code that I had to modify of yours was the After View Init.
As the old pr #41 is back from the es6 days - here is my second try as we really need these callbacks in our project and I finally want to just npm install this lib.