Questions tagged angular12

Explore the latest questions and answers asked by our top developers.

Angular 12: ngModel variable not updating after async get result

I know this issue is very common, but I have done some research already and didn’t find any solution for my case, I have tried some stuff like ngZone and setTimeout but won’t work. What I have is a component using ngModel that is updated via a get done by a service using a utility […]

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’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.scss’] }) export class AppComponent implements OnChanges { @Input() mydata?: string; ngOnChanges(changes: SimpleChanges) { console.log(changes); // This does not appear […]

By deszok
Categorized as angular, angular12 Tagged ,

An Angular website is broken after it’s published in GitHub Pages and its migration to Angular 12 and new GET options were added

Recently, I upgraded my app from Angular 9 to 12 and it looks perfect when I lunch it on my local PC: But it’s completely broken when I published and uploaded it to GitHub Pages: The most important (unrelated to the migration) happens in the component: osm-map.component.ts because I expanded it to get more options […]

How to navigate to Router outlet using Angular RouterLink?

I have a below route defined in my angular 12 app, I am able to navigate to it directly using the browser URL bar. Now I am trying to navigate using hyperlink, like below – it <a routerLink="home/1057/view/(sidebard:view)">sidebar</a> —> Doesn’t work or <a routerLink="/home/1057/view/(sidebard:view)">sidebar</a> —> Doesn’t work http://localhost/home/1057/view(sidebar:view) – works fine when you directly hit […]

Cannot read properties of null reading querySelector in jasmine

I´m trying to test a small reactive form in Angular 12, I have this: The ts file import { Component, OnInit } from ‘@angular/core’; import { DataService } from ‘../data/data.service’; import { IFrequency } from ‘../data/ifrequency’; import { Colaborador } from ‘../data/colaborador’; import { FormBuilder, FormGroup, NgForm, Validators, FormControl} from ‘@angular/forms’; import { ServicioSettings } […]

How to use <parent> and <child> component in template recursion in angular

I have 2 components <parent> and <child>. I want to use them in recursive <ng-template> let say for the sake of simplicity <parent> component will contain <ul> <child> component will contain <li> here is what I have referenced here is how I have tried <div> <ng-template #recursiveList let-list> <li *ngFor="let item of list"> <!– […]

By EaBengaluru
Categorized as angular, angular12, javascript Tagged , ,

put selected value from db in mat option angular 12

i want to put selected value from add action that already save in database to show in edit action in mat-select or mat-option. this mat-select is also used for add action. in add action, the value is empty while in edit action the value from db should be shown. the selected value is a foreign […]

By yami
Categorized as angular, angular12, mat-select Tagged , ,

How to give nested tables/ nested row

I’m trying to implement a table with each row has expand option when clicking on expand it will have a new table for each row all dynamic info. Need some help on how to have a a new table for each row. I tried to implement as show below which works but it creates a […]

Drag and drop issue in cdk/drag-drop when new element is added or the screen is scrolled down

cdk drag and drop issue not working properly when the screen is scrolled down or a new element is rendered before the cdkDropListGroup. After I start dragging, the drag and drop things that the dropzone are still at their original position and there is decent discrepancy in where the actual dropzone is and where the […]

How to iterate values sent from a django restframework in angular12

trying to display the category of my product. However it is only showing the id number for the category, and if i enter {{}} it shows nothing. The category is a foreign key for the product model class. Here are the Angular html and ts components: export class GroceriesComponent implements OnInit { constructor(private service:ApiService) { […]

1 33

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us