We use the same
@Directive class decorator as attribute directives and define a selector in the same way. One big difference here is that due to the nature of structural directives being bound to a template, we have access to
TemplateRef, an object representing the
template tag the directive is attached to. We also add an input property in a similar way, but this time with a
set handler so we can execute some code when Angular performs the binding. We bind
delay in exactly the same way as the Angular built-in structural directives.