I have 2 types of drop-down based on the select value column drop-down will show. (one for to show database data, another one for to show desktop data.) https://stackblitz.com/edit/angular-ivy-3n238j?file=src%2Fapp%2Fapp.component.html app.componet.html My issue is below In 1st row if I select desktop it will…
Tag: angular
Passing variables by reference in typescript [Angular 8]
I have a several variables on the html of the component which are given their values by the typescript file. It is declared in html as follows: In the typescript file they are declared in the global scope as follows: Now these values can be updated using this in a function in the ts file. For example if I wan…
Nested loop returns last 2 values
I’m trying to send multiple items to multiple contacts in my contacts list , I use nested loop but it only send the last item for each contact ignoring the rest of the items , I didn’t know what I’m doing wrong. here are my arrays : here is my JS code : Answer Create an array messagesToSend …
Set option-html disabled if j = 0
Is it possible to set select option disabled, if the value is j = 0 ? The j value is taken from a DB. Answer Try this: or this, if not work: Source: https://angular.io/guide/binding-syntax#property-and-attribute-comparison
Update view when object has been pushed into array in Angular
I have an array of objects, I have added a click handler to manual test pushing an item into that array, It does that successfully, but what it does not do is update the view based on this. Do I need to put the method in the ngOnit? What I have so far just makes the object appear not based
How to use the angular decimal pipe in typscript
I’m using the angular decimal pipe like this: How can I use the same pipe but on a typescript function? Answer I found in a similar question how to use it: just need to import DecimalPipe from @angular/commun and use it as a service: Also, make sure you add the DecimalPipe to your providers angular modu…
How to change a value in CSS using TypeScript?
I want to make an <input> text box where you write a certain color, say ‘red’ and a certain text gets colored like that. I found some guidelines on how to do it, but the code is in JavaScript, instead of TypeScript. So far I got this: HTML CSS JavaScript As I am using .ts classes, I am wonde…
How to pass HTML to JPG/PNG? In Javascript/Typescript
How can i convert an HTML to a JPG/PNG image? I already tried various options but none works for me, they only make the image of some parts of the HTML. Example with html2canvas: TS HTML This error I get when I use the example: “DOMException: Failed to set the ‘adoptedStyleSheets’ property o…
Lazy module not found in Angular version 11
This app is trying to load the BookModule lazily with this configuration: And it’s producing the error: Error: Cannot find ‘BookModule’ in ‘./modules/book/book.module’ Thoughts? Answer Seems like your Angular version is 11. The lazy loading syntax changed. It is something like th…
Where is Identity Server login page and how to customize it?
I use Identity Server in an Angular project (based on .NET Core) and when clicking Login button on our Angular page it redirects us to a login page that seems to belong to Identity Server on https://localhost:5001/Identity/Account/Login? url. I have look at many pages on Angular and View sides in my project, …