"ref" in bind() hook (Au 1)

If I reference an element in the html template by “ref” keyword, in which lifecycle hook is it guaranteed to be available?

<template>
   <div ref="test"></div>
</template>

export class MyComponent {
    test: Element;

    bind() {
        console.log(this.test); // Is "test" guaranteed to be available here?
    }
}

Thanks for any help!

1 Like

It depends, if the element is behind an if or any template controller, there maybe a delay as the ref binding will only be active after the binding has been bound. At least this is what I see it.