Questions tagged angular

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

Cannot read property ‘charAt’ of undefined Get @input

I’m trying to pass my Get method from my parent component to my child component to display the data but I get an error I don’t understand. being a beginner I don’t know how to use the @input here is the error Cannot read property ‘charAt’ of undefined thanks in advance. parent.component.html <app-child[arrayList]="getDetails()"></app-child> parents.component.ts public […]

By Herve
Categorized as angular, javascript, typescript Tagged , ,

Angular – Dynamically load multiple instances of the same component by submitting a form to add a new instance of a component to the display

Problem I’m trying to dynamically load multiple instances of the same component, with a new component being added/loaded to the screen when a user submits a form. The idea behind this is that a user can provide details on the form that is then displayed on that particular instance that component that is created. My […]

Cdk drag image with css transform

I’m using angular Cdk drag drop for couple of images. Each of the image has a click event to apply css transform: rotate 90 degree. The problem is after I clicked on them to rotate and now I wanna drag the image, they keep returning to the original state without the css. Is there a […]

By Thuan Tran
Categorized as angular, css, drag-and-drop, image Tagged , , ,

Jasmine unit testing a return methods output throwing error

I have a method that a string enters, its transforms then returns a new string value. I have tried numerous ways to get it to test correctly, as you can see below there are a few lines commented out. The main issue I am getting is Error: Expected spy on sanitiseIconString to be ‘testing this’. […]

Expect error to be thrown out of next handler of observable, testing Angular with Jasmine

In Angular application have a controller with following method onClick(): void { this.http .get(‘some/endpoint’) .subscribe( (response) => { const editUrl = this.service.composeUrl(response); if (!editUrl) { // want to test this error is thrown, when editUrl is null throw Error(‘Cannot construct valid URL’); } // do something else }, () => { // request clean up […]

Web view for moodle app after npm start command not working properly?

I have followed every steps as mentioned here And then i ran the npm start command and also ionic serve command separately, but command prompt does not show any errors nor the browser console, web browser showing this, What is wrong here ? Source: Angular Questions

Get column index in table header row in Angular directive

I have a directive that allows users change width of columns in a table: <table id="mytable"> <thead> <tr> <th [ktResizeColumn]="true" id="myth"> <tr> <thead> </table> I’d like to save column widths in local storage once they changed. My problem is that I need to know the index of th being changed, till now I have to […]

Getting [Object Object] in Template with *ngFor Angular

My data keeps appearing as [Object Object] in my HTML template when I do my *ngFor loop. Here is my view with the data enumerated in the developer console: Here is my HTML code: Lastly, my TS code: Also, when I iterate through "" as such: I get: I’m storing the response from the server […]

By Dave Guerrero
Categorized as angular Tagged

Webtable scraping from angular data populating

I would like to scrape the table from link and put into panda dataframe but web page do not allowed to inspect data structure as well. Source: Angular Questions

Angular Container Sizing

In my code, I have a table that displays different fields. One field is significantly bigger and takes up a lot of space, more than it needs. How can I resize that field and make it smaller? HTML: <ng-container matColumnDef="StockIntegrationCode"> <th mat-header-cell *matHeaderCellDef> Stok Kodu </th> <td *matCellDef="let row; let i = index"> <span *ngIf="EditIndex […]

1 4,140

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