Questions tagged angular

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

Module Federation Angular multiple microfrontends from same remote host inject() must be called from an injection context MatCommonModule_Factory

I currently face an error in our microfrontendbased Angular 12 application using webpack 5 module federation. The error occurs when multiple microfrontends exposed from the same remote host. We follow the structure of a polyrepo. The remote applications are angular cli projects. The shell is a NX repository. Here is the webpack.config.js from the shell […]

get input values by there class

I have a following angular component ts with an ability to add dynamic fields to a form: import {Component, ElementRef, OnInit, ViewChild} from ‘@angular/core’; import {Buildcompany} from "../../models/buildcompany.model"; import {BuildcompanyService} from "../../services/buildcompany.service"; import { FormGroup, FormControl, FormArray, FormBuilder } from ‘@angular/forms’ @Component({ selector: ‘app-add-buildcompany’, templateUrl: ‘./add-buildcompany.component.html’, styleUrls: [‘./add-buildcompany.component.css’], }) export class AddBuildcompanyComponent implements OnInit { […]

By Bogdan Onyshenko
Categorized as angular, angular13, dom, forms, html Tagged , , , ,

define custom sorting prop in ngx-datatable

Hi I am following complete reference of for ngx-datatable wrapper. And here I stuck with sorting option. My data is like { Id: 1, CreatedBy: ‘2020-01-01’, DateCreated: { ….., value: ‘2020-01-01’ } } and I am passing column to wrapper from parent is like this.grid.columns = [ { name: "CreatedBy", prop: "CreatedBy", sorting: true, […]

By rajnesh
Categorized as angular, ngx-datatable Tagged ,

Angular material table testing Cannot read properties of undefined (reading ‘sortChange’)

In my component grid I’ve got this code: @ViewChild(MatSort) sort!: MatSort; merge(this.sort.sortChange, when I run the test suite I’ve this error: Cannot read properties of undefined (reading ‘sortChange’) I tried fix it with component.sort = loader.getHarness(MatSortHarness); The code above give me the error Type ‘Promise’ is missing the following properties from type ‘MatSort’: sortables, […]

How to pass controls in parent component sent from child component?, check my code here app.component.html: <div [formGroup]="myform"> <h1>Good bye</h1> <child-component (guestData)="fetchGuestData($event)"></child-component> </div> app.component.ts: import { Component } from ‘@angular/core’; import { OnInit } from ‘@angular/core/src/metadata’; import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators, } from ‘@angular/forms’; @Component({ selector: ‘my-app’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.css’], }) export class AppComponent implements OnInit { myform: FormGroup; constructor(private fb: […]

By Parul
Categorized as angular, components, formarray, reactive-forms Tagged , , ,

How to decrease gap between xAxis and labels in amchart?

I am working with amchart v4, using with angular. I want to remove/reduce the default space between ‘x-axis line’ and ‘labels’ Space I want to remove is marked with red line in below image. I have gone through amchart documentation, could not find any working solution. Can anyone help me out in reducing/removing space between […]

By Kanhaiya Ji
Categorized as amcharts4, angular, axis-labels, charts Tagged , , ,

Change label dynamically in typescript

I have a function that takes in a string but depending on which type of file is coming in i want my html label to switch between each other ex: function changename(food: string){ if(food){ this.type = this.getcookiesobservable(food); this.type = this.getcakeobservable(); } } how would i get these two to swap and say "cookies" || "cakes" […]

By Holy panda
Categorized as angular, javascript, typescript Tagged , ,

Angular extraer imagen de un video [closed]

Que tal espero contar con su ayuda, estoy haciendo una plataforma de videos, al cargar el video y darle publicar, quiero que me genere una imagen aleatoria del video es decir obtenerlo a raiz del elemento video. Alguien sabe de alguna librería? o algun tip? QUisiera obtener la imagen del siguiente elemento Source: Angular […]

Angular Merge rows having same values in the first column

i am showing data into a table but some rows (in first columns) have the same value (item.check values ) so i want to merge them and show one value instead of multiple values on top of each other this is my code : <ng-container *ngFor="let item of"> <tr *ngIf="item.num | between:0:22"> <td >{{item.check}}</td> […]

By SpawN
Categorized as angular, html, mean-stack Tagged , ,

Openlayers: Once a layer is removed, new layers won’t be added to the map

I’m a beginner so i might be overlooking something very obvious here: So i have this function, which i call with a button click, to get the layers from the map and if they are either dataLayer2 or dataLayer3 they should be removed and then dataLayer1 should be added to the map. I have the […]

By J L
Categorized as angular, openlayers, typescript Tagged , ,
1 6,179

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