0

The angular documentation has the following information regarding components

Components have a well-defined lifecycle Each component can implement "lifecycle hooks". These are methods that will be called at certain points in the life of the component. The following hook methods can be implemented: $onInit() - $onChanges(changesObj) $onDestroy() $postLink()

https://docs.angularjs.org/guide/component

I have tried different ways to implement them, listening to them, but I can't seem to get it working, I tried different things, like passing a function as argument or assigning a function, tried using $scope, $on and this to no avail. I tried reading the angular source code and there's very little information about it. On this file, compile.js on line 3202 it looks like to use them the right way to do it is to assign a function to it.

Any information is appreciated.

1 Answer 1

1

While writing this I realized that the lifecycle hooks were not available in angular 1.5.0. It was introduced recently in 1.5.3. So if anyone is looking to use them you must upgrade to a latest version of Angular.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.