230 questions
0
votes
1
answer
28
views
Is there a way to set a default value to signal's rxResource() such as signal()
it seems that there is no way to set a default value to rxResource such as classique signals.
I do it like that:
#errorsResource = rxResource<ParseError[], any>({
request:() => ({
...
0
votes
1
answer
17
views
Cant change Angular Materials paginator value after using viewChild signal
I need to change my tables paginators pageIndex and pageSize, my code works well when i use ViewChild, but i want to use signal query, when i use signal query i got this error;
Writing to signals is ...
0
votes
0
answers
13
views
Why signal values can update UI without any lag but non-signal values sometime may bring lags in ui?
We can use 2 ways of displaying a variable's value in template. Either use a signal or non-signal. I observed that using signals allow to update the UI instantly without any lag, but using non-signal ...
1
vote
1
answer
34
views
Angular 18 input signal instead of @Input
Hi I'm having doubt I'm using input signal instead of @Input I'm sending data from parent component one as simple variable like and another as signal
name = "ajai" name=signal("ajai&...
1
vote
1
answer
44
views
Angular toSignal's read-only result as a writable signal
In my Angular service, I currently have a signal variable loginById$$ initialized from an observable:
public loginById$$: Signal = toSignal(this.getLoginById(), { initialValue: {} as LoginResponse });
...
1
vote
1
answer
59
views
Angular linked signal dependent on two other signals
In new Angular (19+) can I create linkedSignal that depends on two other signals?
In the example
import { signal, linkedSignal } from '@angular/core';
const sourceSignal = signal(0);
const ...
1
vote
1
answer
51
views
Using Angular v18 resource with HttpClient
I'm trying to update my code to use the new Resource type. The Angular documentation for Resource has this example:
const userId: Signal<string> = getUserId();
const userResource = resource({
...
2
votes
1
answer
37
views
How to set signal-based input value of dialog component instance?
Today, when we use a component in a dialog, we can pass the value of an input this way:
@Component({
selector: 'app-foo',
template: '{{ data }}',
})
export class FooComponent {
@Input() data: ...
1
vote
1
answer
56
views
Angular 18 + Jest - Unable to spy on signal set method
I have a component that changes the value of a signal declared in a service on its initialization. I'm trying to test this declaration using Jest and spying on the set method of the signal, but with ...
1
vote
1
answer
45
views
how to replace a service with a Subject with signals?
Say I have a very simple shared service holding a subject:
@Injectable({ providedIn: 'root' })
export class MyService {
private _runTaskSubject = new Subject<string>();
get ...
0
votes
1
answer
55
views
How to use input signal in service?
I have a component which gets an array as an input signal:
export class MembersComponent {
members = input.required<Member[]>();
and a service
constructor (private service: MyService) {}
the ...
1
vote
1
answer
34
views
How do I use Angular's inject within a canActivate function?
In the following canActivate function, I need to get the number of Items in a cart. I inject the CartService for this purpose but am getting an error that inject() must be called from an injection ...
1
vote
0
answers
26
views
signals return error: is not a function at Object.computation [closed]
this is my cart service code:
export class ManageCartItemsService {
cartItems=signal<CartProductModel[]>([]);
item={} as CartProductModel;
}
and this is my code for showing cart items ...
1
vote
2
answers
65
views
passing an Angular Signal Input value from a service into a component
export class SpecificComponent implements AfterViewInit, OnDestroy {
/** Component configuration object */
ConfigData = input.required<Config>();
// some code
}
Assuming I have Angular ...
2
votes
2
answers
116
views
Updating a template using signals within a @for loop is not working
I have been trying and experimenting with a load of different approaches, but I cannot seem to get it working that my template gets updated.
Currently the situation: I have an Angular 19 app, ...