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.

How to read csv file content in AngularJS?

I want to read a csv file and get its content by using AngularJS and HTML5. I want to put …

angularjs html csv angular-directive
How to pass values to directive in angular

My code, <modal *ngIf='showModal' [imageValue]="imageId"></modal> My model component, @Component({ selector: 'modal', templateUrl: './…

angular typescript angular-directive
Emit event from Directive to parent element

I have an element in HTML template of an Angular 2 app. I add a directive to it: <div myCustomDirective&…

angular angular-directive
Make directive @Input required

In AngularJs we could make a directive attribute required. How do we do that in Angular with @Input? The docs …

angular angular-directive
Angular 4 - how to render 2 decimal places for type='input'

This question is about restricting/validating the input when the user enters data into an input of type number. The …

angular angular-directive
Setting view value an input field in a unit test of an angular form directive

I have a directive that builds a form: app.directive('config', function() { return { restrict: 'E', scope: { data: '=' }, template: …

angularjs unit-testing angular-directive
Angular 2 why asterisk (*)

In angular 2 document, * and template, we know that the *ngIf, *ngSwitch, *ngFor can be expanded to ng-template tag. My question …

javascript angular angular-directive
Detect Click outside element in angular 4 using directives

I have used a custom directive to detect click outside an element in angular 2 but the same is not possible …

angular angular2-directives angular-directive angular-observable
Dynamically append component to div in Angular 5

I have this https://angular-dynamic-component-append.stackblitz.io/ I managed to dynamically append an element, but it doesn't get compiled. I …

angular typescript angular-directive angular5
What are the main differences between components and directives in AngularJS 1.5?

I am finding it difficult to understand the real difference between components and directives. I now understand that components are …

angularjs angular-directive