1,818 questions
0 votes
0 answers
33 views
How to mock NgxSummernoteDirective
I am testing an angular component, which uses a summernote-editor from NgxSummernoteModule. The editor form ist set up by NgxSummernoteDirective using the methode createEditor(): createEditor() { ...
0 votes
1 answer
52 views
Angular Material "Select All" Directive Not Deselecting Correctly on Single Option Change
I'm implementing a custom directive to handle "Select All" behavior for a multi-select dropdown using Angular Material. The issue: when I deselect just one item, the "Select All" ...
2 votes
3 answers
187 views
Angular Directive - Change color of button on hover
I have this button: <button class="btn-submit" type="button" appControlhover [defaultColor]="btnBackgroundColor" [highlightColor]="btnhoverColor" [...
2 votes
1 answer
207 views
Reactive form custom directives not run OnInit or when hidden input shown by *ngIf
Using reactive forms in Angular I created two directives one that converts values from cents to dollars by dividing by 100, and one that converts dollars to cents by multiplying by 100. This works ...
-1 votes
1 answer
161 views
Is it possible to render Angular component dynamically using Selectors?
`Is it possible to render an Angular component dynamically? For example, I have component selector names in my .ts file. When I bind the variable in the .html file using interpolation and innerHTML, ...
4 votes
2 answers
7k views
Angular 17 - How to indicate both else to same ng-template for *ngIf using @if @else
I am trying to convert my code directives from Angular 16 to Angular 17. However, I am unable to achieve the reference in Angular 17 so that for both else it will refer to the same ng-template. <...
0 votes
1 answer
106 views
how to mock a standalone directive?
Anchor tags from the table cells are attached with a [routerLink] directive. My aim is to test the table. I would like to mock the directive. How can I do this? More detailed question: how to provide ...
2 votes
1 answer
67 views
Is there a way to find if the user has reached the bottom of an unscrollable div using HostListener and directives in Angular?
In my angular application, I have a main layout with a flex display that has a height of 100vh and overflow set to hidden. Inside is the main content div which has a height of 100% and overflow set to ...
2 votes
2 answers
87 views
InnerHTML of div is missed after hiding div
I am using Angular 17 and Tailwind, my directive adds and removes 'hidden' into the class of marked <div> when checking the select/unselect situation of the checkbox. My problem is that the ...
0 votes
1 answer
1k views
Can't bind to the input of a standalone angular directive in unit test
I'm trying to write a test for a directive that modifies the Angular CDK table. To test this I made a test component decalred in my *.spec.ts file, where I setup a simple table and add my directive. ...
2 votes
1 answer
355 views
Angular host listener property in component decorator with logic
I have a SidebarComponent: import { Component } from '@angular/core'; import { MenuComponent } from '../shared/menu/menu.component'; @Component({ selector: 'app-sidebar', standalone: true, ...
2 votes
1 answer
82 views
Angular form status validator 2
I'm trying to write custom form validator. I have two component main-form and options. In options component I have list of checkboxes, and would like to validate, that on each row is checked at least ...
1 vote
1 answer
106 views
Angular form status validator
I'm trying to write custom form validator. I have this test component, where are three checkboxes. Main form should be valid only if at least one checkbox is checked. https://stackblitz.com/edit/...
3 votes
1 answer
4k views
Angular 17.1 Signal Inputs on directive?
I'm able to use the new Angular's 17.1 Signal Inputs as follows: { public value: InputSignal<string> = input.required<string>(); } And while it works on components, it does not on my ...
2 votes
3 answers
1k views
Using directive output in Drective Composition API
The Angular Docs show that you can use Directive Composition API even when directive has outputs. However, it seems that directive's outputs become component's outputs. I'd like to use directive's ...