67 questions
2
votes
1
answer
74
views
Angular input signal: how to accept `string | undefined` from parent but always get `string` inside the component?
I created this simple component that has two inputs that both accept a string and in theory should accept undefined because they have a default value.
@Component({
selector: 'app-child',
imports: [...
2
votes
2
answers
87
views
How to detect change in dynamic objects property?
I have 5 dynamic objects out of those 5, I am referring to only 2 here:
objCache.tab1.page1.status: when cache enable from tab
objCache.page1.status: when cache enable from page
In my html and .ts ...
0
votes
0
answers
23
views
How to access child component form field in parent component angular
Parent Component ts
Obj1={ name:"foo" fname:"Bee"}
Obj2={field1: "data", field2:"data2" , filed3:"data3"}
html :
<form #f="ngForm">
&...
5
votes
1
answer
690
views
How can I set a default array value for a required Angular input signal?
When using Angular signal inputs if I want to specify a required input array
import { input } from '@angular/core';
values = input.required<number[]>([]);
I get the build error (StackBlitz)
...
1
vote
1
answer
49
views
Unable to send the parameter value to another component using angular ng2-smart-table
I am using Angular ng2-smart-table and am having trouble sending the value of a parameter to another component. The value is coming through as undefined.
Actually, want to enable or disable the toggle ...
1
vote
2
answers
92
views
Dynamic Component Outputs
I have 2 components in Angular, a parent and a child. I'd like the parent to be able to
pass an array of objects representing a clickable thing to the child
have the child component dynamically ...
0
votes
1
answer
36
views
Onclick of the list item button name should display which is in array
i have been trying to display the name of the array item onclick of the user button but onclick of that i m getting name of the user in console but not in page level
this is the app.component.ts file ...
2
votes
2
answers
3k
views
How to read the array in an Angular signal when it changes to an input signal?
Note that this is using Angular 18.0.0.
I am updating code to change from an observer to a signal. Instead of watching the observer, I want it passed into the component as if it were @Input. As an ...
1
vote
1
answer
228
views
Angular Input Signals and sanitized values
I thought that I can use an URL as input Signal in my preview.component like
hrefLink = input.required<SafeValue>();
and in the .html use it like
<img [src]="hrefLink"/>
I have ...
1
vote
3
answers
7k
views
How can we get previous and current value of a Signal based Input in Angular v17?
In earlier versions of Angular, ngOnChanges provides SimpleChange which is helpful in getting previousValue and currentValue of an @Input property.
I want this same functionality in Signal based ...
1
vote
2
answers
671
views
why is my input setter called even without changes
I have typical setter/getter for an input in my code, as I want to execute a function when the value changes, but somehow it is fired without input changes
private _myInput: string[]: [];
@Input()
get ...
0
votes
1
answer
238
views
Why Angular Input is undefined?
I have typical easy situation but in that case @Input() does not working...
Child Component:
@Component({
selector: 'app-test-grid',
templateUrl: './test-grid.component.html',
styleUrls: ['./...
0
votes
1
answer
346
views
The reason for using the eventemitter to send data from the parent component to the child (Angular)
While learning Angular, I realized that there is no need to use eventemitter to send data from the parent component to the child component, while the eventemitter must be used to send data from the ...
0
votes
1
answer
487
views
change variable when inputs changed in Angular
When numbers are entered in the price(Fiyat) fields in the picture, I want the place that says 0 TL to change. The place that says 0 TL should be the sum of the numbers step by step. How can i do that?...
1
vote
1
answer
478
views
Why not get the value passed from the parent component to the child component correctly?
I need to pass a variable value from the parent component to the child component through an input. That is, the screenMode value received through the above ng-container needs to be given to the add-...
1
vote
1
answer
630
views
Using @Input between parent and child component via routing module in Angular
This is parent component :
parent.component.ts ==>
import { Component, OnInit, Input } from '@angular/core';
@Component({
selector: 'app-parent',
templateUrl: '<div>
<...
1
vote
0
answers
1k
views
Manually set angular <input> value back to the [value] property after typing some text
I have a component where I can select an item from a list. There is another section on the screen where the data of that item is shown on the screen. In this data display section, there I have ...
7
votes
7
answers
12k
views
Angular mat-form-filed input disable autocomplete
I am using angular material for all my controls. We have a requirement to disable auto-complete so that any previously typed value will not show up.
I have my code as below. I tried autocomplete "...
3
votes
1
answer
545
views
How to use in Angular inside an arrow function an object property (deeper than 1st level) sent by input?
I'm using angular 7 and trying to do something in a child component : use the input property that can be at first level in the object or deeper.
My child component has this piece of code :
if (this....
0
votes
1
answer
265
views
Can't bind to "attribute" && "app-component" isn't a known element
I've a HUGE problem. The entire thing started with this: Fix corrupted HTML file or decompile Angular Component
My PC suddently crashed and from that event it become worse every second. I get weird ...
2
votes
0
answers
2k
views
Angular Inline-Editing Component
i'm searching an Component/Plugin/Way for inline-editing in Angular like Jira. I have recorded a sample gif Sample GIF:
Does have anybody a component like this? I will be happy to hear your ...
0
votes
1
answer
176
views
matInput binded to context property conflicts with i18n extraction but not on regular serve
I have that piece of code of a reactive form that compiles right and is well executed with the matInput directive which is binded, but when I run the angular cli command for internationalisation (ng ...
0
votes
1
answer
162
views
Button Status can not be changed in a child component
I have a problem in my angular application that Button Status can not be changed in a child componnent, now I show my code firstly.
this is a child component
<child-component
[(...
0
votes
1
answer
2k
views
Angular 7 correctly upload doc/docx file
I'm having troubles uploading doc and docx files, because I can't get the right type of file when converting it to base64. This is my input:
<input
accept=".pdf,.txt,.doc,.docx"
...
7
votes
4
answers
14k
views
Angular Change detection not working with ChangeDetectionStrategy.OnPush in HttpClinet.Subscribe
I have reproduced a simple stackblitz demonstrating the issue I have been having. The problem is that I have a parent component that passes a boolean to a child component. This boolean is an @Input on ...