Questions tagged [angular-arrays]

31 questions
0
votes
1 answer

how can i show the data received from backend api in angular

Im currently trying to show the data of an employee after he loggin to his account, i can get the data of the employee from the backend by his username and i can console logged it , but when i assign the data to another variable of type any i…
0
votes
1 answer

ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. Getting this in get API

This Error is coming when I am trying to show the data from an get api on html template using ngfor in angular ERROR Error: Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only supports binding to Iterables such as…
Kishkin
  • 7
  • 1
  • 5
0
votes
1 answer

Angular - Passing FormBuilder values to Array results in empty string values

I have a form that I fill out using Angular's FormBuilder. This is the FormBuilder representation in the component typescript file: constructor(private Form: FormBuilder) { } AddStatusBoxForm = this.Form.group({ cpuTempTopic: [''], …
0
votes
3 answers

Angular - how to reuse a standard data array

I am using a Indian states data array like the below in various components of my Angular project. I know one way is to add it as a collection in backend database. But I would not like to make an API call to get the state names every time a dropdown…
hemant
  • 377
  • 1
  • 2
  • 13
0
votes
1 answer

How to display data array without duplication in angular 9?

Html file: // First Table has array data --> name,netCash,phonePay2,card,cellPay2,total2
user14286123
0
votes
1 answer

how to map two arrays in Angular 8

I have two arrays partyCtx and planList partyCtx looks like this: partyCtx: Array(5) 0: {planCode: "PLN00062", planShortName: "Federal Home Loan Bank of A", employerPartyID: "", employerShortName: "", hasPayrollCenter: false, …} 1: {planCode:…
Margerine
  • 183
  • 1
  • 4
  • 14
0
votes
1 answer

Pass data to Array of Child Components in Angular

I have parent component and child components in my project and array of objects called from API in parent component. Parent Component public Questions = []; ngOnInit(): void { this.loadQuestions(); }
0
votes
0 answers

Display Array Objects in Dropdown- Angular Firebase

I want to display the items from the "cabinet" array in a dropdown. I've tried the below code, but it's not working. Please help. Component.ts File: getProductDetail(id: string) { const x = this.productService.getProductById(id); …
0
votes
2 answers

how to create a hyperlink for values from an array in Angular 8

I have data that looks something like this plans:[ { "planName": "PlanA", "planCode": "PLN001" }, { "planName": "PlanB", "planCode": "PLN002" }, { "planName": "PlanC", "planCode": "PLN003" } ] I need to display…
Margerine
  • 183
  • 1
  • 4
  • 14
0
votes
1 answer

Getting a specific DOM element in angular component using click HostListener from an array

This is a little bit harder to explain, but I will do my best. I have a component called feed, and the component it expects an array(feeds) of objects(feed). I have a template which i display all the feeds and the way i create them is using…
0
votes
1 answer

Angular getting from forms arrays

I'm making CRUD app in angular 6 but when i go to edit page i want to pass data from array to the input fields on that page, but when i save that page data should be again in the array (you can see on pictures) because i have to save it like a…
Darko
  • 75
  • 1
  • 9
0
votes
3 answers

Angular 6 HttpClient assign resulting payload to array

I am attempting to do a get call in angular the call itself works as I can put a log in the subscribe and see the returned data the issue I am having is I can't seem to assign the data to my existing array (Currently Empty) and as the code below is…
bobthemac
  • 1,172
  • 6
  • 26
  • 59
0
votes
1 answer

Angular service code is running with a delay

I am new to angular. Learning Angular 6. Trying to fetch data from a database which is working totally fine. But I am trying to get the length of the returned array also. Problem is the code for getting the length is being executed before the array…
0
votes
1 answer

How to convert array value recieved from dropdown multiselect to string in angular 5

I have used a material dropdown multiselect through which the users can select multiple data. when the data is being sent to the component the data is recieved in an array format which is not accepted by API to insert into database. My view code: …
Atul Stha
  • 1,404
  • 8
  • 23
  • 46
0
votes
2 answers

Angular 2 array template update not working

I have a component that is using the cordova BLE plugin. When the scan starts to find devices it pushes each device found to an array of objects. In my template I use *ngFor to loop through the objects but the template is not updating and showing…