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.

Angular 2 - Error: No provider for FormControl

I writing a library for the community, which needs access to the form control and listens on the value changed. …

angular angular-directive angular-providers angular-validation
AngularJS directive watch parent size change

Problem I have a simple directive that executes sizing updates on a particular element. This watches the window size and …

javascript angularjs angular-directive
Angular `<router-outlet>` displays template twice

I'm using angular4 and trying to create a router link. The router link works but displays the template twice. Below …

angular angular-directive
How to test a directive with a mouse wheel event in angular 2 / 4

I have a directive which has a mouse wheel event, it is used to zoom in and out a canvas. …

javascript angular angular-directive
Angular Using Directive with @HostListener to Update Input Value of ReactiveForm is Setting Input to ngValid Instead of ngInvalid

I've put together a currency attribute directive on a ReactiveForm FormControl that uses @HostListener on an input event (onKeyDown) to …

angular angular-directive
Angular Directives: scope vs bindToController

Since Angular v1.4, it's possible to do this: scope: {}, bindToController: { name: "=" } instead of old way of doing: scope: { name: "=" }, bindToController: …

javascript angularjs angular-directive
Can a directive delete itself from a parent scope

Let's say I have the following code <div ng-app="app" ng-controller="controller"> <div ng-repeat="instance in instances&…

javascript angularjs angularjs-scope angular-directive
Angular: access FormControl from Directive

I would like to add validators dynamically to my FormControl via a custom Directive. @Directive({ selector: "[idNumber]", }) export class IdNumberDirective …

angular typescript angular-directive
ng-class if object exists angularjs

How can we activate class if object exists. i have a json array where i need to activate a class …

angularjs ng-class angular-directive
How to use directive that sits in a different module

angular.module('mod1', []) .directive('myDir', ($timeout) => { return { ///.... } }); angular.module('myApp', ['mod1']) <html ng-app="myApp"> <…

angularjs angular-directive angular-module