Top "Angular2-directives" questions

Use for questions about Angular 2+ directives

How to dynamically add a directive?

How to dynamically add (inject) a directive into host? I have a myTooltip directive and I would like to add …

angular typescript angular2-directives
directive click outside angular 6

I upgraded my Angular from 4 to 6, and consequently had a problem with my click-off policy, it stopped working on all …

angular angular2-directives angular6
How to Include moment-timezone in Angular 2 App

I realize, this question is repeated but previous once does not provide apt answer moment package was already installed 1.Installed …

node.js angular angular2-directives angular-moment
angular 2 access ng-content within component

How can I access the "content" of a component from within the component class itself? I would like to do …

javascript typescript angular angular2-directives
How to append dynamic DOM elements from a directive in Angular 2?

I have an Angular 1.x directive that appends an element. In short: app.directive('mydirective', function() { template: '<ng-transclude&…

angular angular2-directives
Angular 2 Slide Up and Down Animation

I recently built the following Angular 2 Read More component. What this component does is collapse and expand long blocks of …

angular typescript angular2-template angular2-directives
How to Unit Test a Directive In Angular 2?

Problem: I would like to be able to unit test a directive in Angular 2 to make sure that it properly …

javascript angularjs unit-testing angular angular2-directives
When to use square brackets [ ] in directives @Inputs and when not?

I'm confused a little. See this simple directive: @Directive({ selector: '[myDirective]' }) export class MyDirective { private text: string; private …

angular typescript angular2-directives
Uncaught exception in promise when when trying to use nested components

I am getting this exception when trying to use nested components: EXCEPTION: Error: Uncaught (in promise): TypeError: Cannot set property …

angular angular2-template angular2-directives
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