I have two components called Employee and Form in my application. There are 2 mat-autocomplete: State and City lists in EmployeeComponent. I fill and pass these mat-autocomplete controls to the FormComponent using “formData” parameter: Employee Component: html ts Form Component: html At this point, when I select a state I want the cities list is cleared and the filled by
Tag: angular
How to filter the data from the list and remove the existing room from the data in angular
What I’m trying to do here is to filter the data from the roomList and remove the item from data when they are the same ids. the expected output should be like this: I tried to use a filter and map. Answer Probably best to first reduce() the room IDs to a Set and then filter() based on that: Complete
Error in *ngIf on one element not letting *ngFor to work properly on another
Initialization of variable in one element and error in console that I had been ignoring all along, created a problem elsewhere in another element. Why does angular behave this way? When I do not initialize another variable, which I am using with *ngIf, javascript throws up “undefined” while testing its length (expected). But this also causes *ngFor to not work
Kendo UI Grid for Angular disable a Textbox if the Checkbox is not checked
Kendo Ui for i like to enable textbox when check box is cheked only. below code. I have tried onselection of checkbox but it changing to all rows. need to change only checked row Answer You will need to create a function to track the selected rows: StackBlitz: https://stackblitz.com/edit/angular-ajpix8-gj9vdu?file=app/app.component.ts
Change dynamically css proprety of various inputs in angular
I would like to know the correct way to do one thing. I have those buttons, and I want the opacity of a button to increase when pressed. I’ve done lik this, but I’m afraid it’s not a good solution… I always hear that use jQuery in angular is not a good thing, so I try to not use the
Angular DatePipe to print Datetime [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question I get the next object from database: And i need to print the
How to unit test a mapbox popup with jasmine testing?
I have a mapbox popup. I am using jasmine and I want to write a unit test for it. So I have this function: and this is the template: and this is my unit test: But I get this error: So what I have to change? Thank you Answer I dont think you should be testing like that. To test
Loading in Background in iOS. Nativescript [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I have to download a large amount of data from the server and continue doing it in the background even when
How to customise popup from mapbox
I have angular 8 application and I can show a popup. But I want to style the popup. But how to do that? SO I have this template: and ts: and css: but nothing change. The popup stays white see image. So what I have to change? Thank you So in css: toggle-layer.component.scss I have this: Answer Should work:
Angular – Speed up filtering and display of *ngFor
I have a list of users (at the moment about 450) which I filter using a onValueChanges subscription and javascript filter method. It seems pretty slow. I believe it should be quicker but am unsure if it is the actual filtering of the object or the rerendering the html that is slow. When I recreated it in stackBlitz it is