Skip to content
Advertisement

Tag: angular

Angular – Find a given value in an array within another array

I have an angular app, where I need to check security groups on a machine (array of security_groups). I have a function that receives the serverId and checks array of machine details in the security groups attached on the server, that security group is an array of object. I tried to do this but with a map function, but I’m

filter value of select to do a partial sum

Having two classes professor and student: professor.ts student.ts To add up the scores of each student relative to his teacher I did: This is the HTML of the page: How can I do a partial sum of the selections, assuming for example that I have 5 professor with 1 student for every professor, and want to add only the results

loading different values into select angular

Hi I have a problem with loading data from localStorage into a select component. I would like each select after selecting different options to be saved in localStorage and after refreshing the page, the value from the select will be remembered, currently the last option is remembered and loaded to all app.component.html select.component.html select.component.ts Answer It will be much easier

Angular – Scroll Event only page scroll

I need to check scroll event for a “show more” features. Im using: and this code: Unfortunally the scroll listen to every scroll in page, for example a scroll inside a DropDown etc… How can I listen ONLY the PAGE scroll ignoring everyelse? Answer One solution might be to use hostListener from Angular (https://angular.io/api/core/HostListener) in your page component or you

How to filter data on Object in Angular

I get data from backend with this function and console.log(response) show JSON like below What I want are data that have “is_family_member”: false, for this I create this.personmembertrue = this.persons.filter(x => x.is_family_member === ‘false’) this part of code show empty. Any idea please how to show data with “is_family_member”: false Answer Change the condition to: See if that works.

A problem with “No value accessor for form control with name”

I’m preparing a stackblitz for a problem that I have with child-parent communication, but along the way, I’ve been confronted with a different issue, namely, I’m getting the following error: No value accessor for form control with name: ‘endDateFC’. This happens also for startDateFC. I tried the following things from SO: I added ReactiveFormsModule and FormsModule I removed the duplicates

Dropdown is still disable even after selecting a value

There are two dropdown buttons d1 and d2. d2 is disabled. After selecting a value from ‘d1’, ‘d2’ is still disabled. On using [disabled]=”selectedCountry” d2 is disabled but not disable if [disabled]=”!selectedCountry” I want to make d2 selectable only if d1 is selected. Answer [disabled]=”selectedCountry” means if you have some value for selectedCountry it will be true, which means its

Advertisement