Top "Angular-directive" questions

At a high level, directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tells the Angular 2+ framework to attach a specified behavior to that DOM element or even transform the DOM element and its children.

"Trim" directive for angular 2 and reflect changes to ngModel

I want to create Angular 2 directive that will tirm spaces only from begining and the end of the text that …

angular angular-directive angular2-ngmodel
Angular gives @angular/core 404 not found error when using directives

When I add in this line of code into my @Component: directives: [HeroDetailComponent] The code breaks, and gives me this …

angular angular-directive
How to access host component from directive?

Say I have the following markup: <my-comp myDirective></my-comp> Is there any way I can access …

angular angular-directive
Angular 4 call directive method from component

i'm trying to build a structural directive that will change the parent DOM structure either invoked by using its selector (…

angular angular-directive angular-components
How to prevent double click in Angular?

I have a component with click. <my-box (click)="openModal()"></my-box> When I click this element, openModal …

angular rxjs angular-directive
Syntax Error: Token ':' is an unexpected token when passing variable to directive

I have a directive called iframely and I it inside an ng-repeat like this: <iframely url="iterator.url">&…

angularjs angular-directive
How to add/remove class from directive

Using a custom directive how would you add/remove a class on the host element based on a specific conditions? …

angular angular2-directives angular-directive
Angular2 on focus event to add class

I'm looking to update an Angular 1 app to Angular 2 and am having an issue with one of my old directives. …

javascript jquery angular angular-directive
Communicating Events from Parent to Child in AngularJS Components

in the new project I'm working on I've started using the components instead of directives. however, I've encountered an issue …

javascript angularjs angular-directive angular-components
Using 'require' in angular component

According to the docs (specifically, the table comparing directives to components), angular components allow requiring other directives (or is it …

javascript angularjs angular-directive