Questions tagged [angular12]

For questions regarding programming in Angular specific to version 12. Please include all relevant tags on your question; e.g.,[Angular], [TypeScript], etc.

664 questions
-1
votes
1 answer

Angular 12 / Typescript issue with type never

I am using Angular 12 and this code below is complaining. this.recorder.ondataavailable = (event: { data: any; }) => { this.recordedChunks.push(event.data); }; Typescript is giving me this error: Argument of type 'any' is not assignable to…
deszok
  • 145
  • 2
  • 14
-1
votes
1 answer

ngOnChanges not firing at all on my component

I am trying to test ngOnchanges so I've created a new project and here is my app.component.ts and .html app.component.ts: import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; @Component({ selector: 'app-root', …
deszok
  • 95
  • 1
  • 10
-1
votes
2 answers

How do I pass an id and object on click of a button from one component to another component' s function in angular?

I've 2 components in my app. On click of a button in one component, I want to call a function in other component. The function takes an id as an argument and needs an object. I am able to send either the id or object from first component using RXJS…
A V
  • 9
  • 5
-1
votes
1 answer

Increase and Decrease Quantity of products in angular 12

I am trying to add no. of quantity for a product using angular 12 but when i clicked on add button but its adding for all products like shown in image. screenshot of issue HTML Code
chethan
  • 42
  • 10
-1
votes
2 answers

Difficulty to display json object from an api in angular 12

I'm sorry by advance i will not be precise on the terms. I'm in traineeship and I have to display the json content of an api. I'm able to use console.log and to see the data, but I can't display what i have to display in my html. Where i want to go…
ryoune
  • 1
  • 2
-1
votes
1 answer

How can i achieve autofill feature while email is already exist in database or API In angular 12

If the email is existed in database, then all the required input field get autofill How I can achieve this feature in angular with using API.
-1
votes
1 answer

How to Create Date Count timer selecting date from the date picker input and show the difference of selected date to current date

** This is My Typescript file ** import { Component, OnInit } from '@angular/core'; import { interval, Subscription } from 'rxjs'; @Component({ selector: 'app-timer-app', templateUrl:…
Amir Shahzad
  • 182
  • 2
  • 10
-1
votes
1 answer

Cannot read property 'push' of undefined in Angular 11

When I call my function is throwing an error. I'm trying to insert my items via a forEach in angular. Below is the code which I tried. Ts code sItems: SaleProduct[]; btnSale() { let tsale = new SaleProduct(); let tcustomerId =…
Mervin
  • 35
  • 1
  • 8
-1
votes
1 answer

Can't make a x-www-form-urlencoded POST in Angular

I have a working POST and GET service and see no issues with CORS or such. However, I simply fail to mimic the call performed in Postman (where it works) and the only thing I can imagine is that I somehow set the x-www-form-urlencoded format…
Konrad Viltersten
  • 36,151
  • 76
  • 250
  • 438
-1
votes
1 answer

Property does not exist with NgModel and pipe in angular 12 app

i am new in angular 12, I created a search input and a list of static data, and I decided to write a pipe to filter the data when I search something, So after I added the pipe inside the ngFor I got an error that says : Error:…
-1
votes
2 answers

What is the best place to implement shared method between different components in angular?

I'm trying to implement snackbar angular material component on my project. https://stackblitz.com/angular/ygomllvemnl?file=src%2Fapp%2Fsnack-bar-component-example.ts This element(component) is used by 3 other components. So I need to implement the…
-1
votes
3 answers

Angular blocked by CORS policy preflight response

I'm making a reques in Angular 12, with a valid token in the header, in postman it works, however, if I run it from the browser, I get the following error, from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field…
Manuel
  • 23
  • 1
  • 6
-1
votes
1 answer

How to load images in angular other than default assets folder

I have a folder directory structure here: I have provided the image path in html.  configured in angular json But is not loaded Its working well in default…
Mohamed Sahir
  • 2,482
  • 8
  • 40
  • 71
-1
votes
1 answer

Angular 12 Chart.js - Cannot display doughnut

I am able to display a line graph and a bar chart. But for some reason I am not able to display a pie chart or a doughnut chart. I have gone through various tutorials and tried various things. I cannot figure this out! Here is my code: html
Ree
  • 863
  • 2
  • 18
  • 38
1 2 3
44
45