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
Tag: angular
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
Converting a complex timestamp to normal time in angular
I have a time stamp like 2021-03-12T14:55:35.454Z I want to convert that into normal time like this (below) in the ts file 2:55pm I am working in angular. Please help if you guys know. I have tried searching other stackoverflow questions but I couldn’t find the exact solution Please help if you guys know Answer Use, Angular’s built-in DatePipe. if
How to access the properties of a formArray in HTML?
I’m trying to implement a reactive Angular form, but, I can’t access the properties of the array on HTML, I never worked with reactive form, if anyone could guide me I would be grateful! I’m using Angular 10 and I have the following code: TS HTML Models error-handler.service.ts:87 Error: Cannot find control with path: ‘workStations -> 0 -> rank’ @
How to show in template property from array of objects
I just try to show the value of a property in the template. But at the moment nothing is shown. So this is the component: And this is the template: So I just want to show in the template the value of key. And the console.log returns this: So I don’t get any errors. But also nothing is shown. Answer