Category : components

I have build a component in Angular that imports an excel file and convert it into an array and then delays the content on the excel file on the page as a table. This works perfectly if I build the fuction in the component as follows: data-import.compoent.ts import { Component, OnInit } from ‘@angular/core’; import ..

Read more

I have a form with a custom component <app-custom-component [(ngModel)]="myValue"></app-custom-component> In the custom component i have an input which i also use ngModel <input [(ngModel)]="myValue" /> Basically myValue is bound to a custom model and the same myValue is bound to the input inside the custom model. I want the errors of the input’s ngModel ..

Read more

On my Angular 8 project, I defined a function in projects.component.ts that I would like to use in update.component.ts. I know how to import this function in update.component.ts, all’s fine there. The problem is that we need, at some point, to change a function, because the reloading function is not the same in projects.component.ts and ..

Read more

I am developing an app and for now, I have a dynamic grid generator which divides the space in the screen to fit several components dynamically. So, the component encharged of this must render the components after angular has rendered the page. In order to achieve that I’ve followed the angular dynamic component loader guide ..

Read more

Error : No overload matches this call. Overload 1 of 5, ‘(observer?: PartialObserver | undefined): Subscription’, gave the following error. The following is my code: List-address.components.ts import { AfterAuthGuard } from ‘./../../guards/after-auth.guard’; import { AddressService } from ‘./../../services/address.service’; import { Component, OnInit } from ‘@angular/core’; import { Address } from ‘src/app/models/address’; @Component({ selector: ‘app-list-address’; templateUrl: ..

Read more

The components are generated through an ngFor. The same click event handler is bound to all of them. I want to capture the Component on whom the user clicked inside the event handler as an argument. Template <div> <app-my-component (click)="pageClicked(<sender>)" *ngFor="let page of pages"></app-my-component> </div> Code Behind pageClicked(sender: MyComponent): void { // sender would be ..

Read more

I am trying to dynamically create components based on a string, and the dynamic components will have @Input fields that are needed from the parent. Here is a snippet of how I am dynamically creating the components import { Component1 } from ‘../../Component1.component’; @Component({ … }) export class DynamicContainerComponent implements OnInit { static map = ..

Read more