Category "angular-directive"

When is useful to use a custom directive in Angular?

In the angular docs there's an example of how to build a custom directive that hightlights a paragraph (or any HTML element where this directive is applied) on

Using CSS hover property in Angular directive?

Here is the directive, the default one. import { Directive, Input, Renderer2, ElementRef } from '@angular/core'; @Directive({ selector: '[newBox]' }) export

How to affect the directive children using @HostBinding?

I'm implementing a bootsrap's single button dropdown (docs). In order to make it to be "open", it must add a show class to main <div> and to the <ul>

event.preventDefault() or event.stopPropagation() not working with keyUp event

Directive file: I am trying to do that if my counter goes above two it should stop event or keyUp to reflect but is it not working. Can someone help me on this?

Angular 9 Ivy, NgControl not initialized in Directive

I'm attempting to update my project to Angular9 / Ivy and face following problem. I have a custom "disabledControl" directive, as described in the following Blo