(SOLVED) How to Share Data between Angular Components ?

How to Share Data between Angular Components ? its a common question asked by angular developers… Data sharing is an essential concept to understand before diving into your first Angular project. In this tutorial, we will show you the most used methods for sharing data between Angular components. Of course , if we talk about […]

En Lire Plus

(SOLVED) how to insert an HTML element before another ?

If you need to insert an HTML element like one <div> or any other element before an existing element in the HTML Document you have to : 1. Get the element by ID : 2. Create the HTML element 3. Insert the element Here we will use insertBefore function to insert the created Div before the recovered Table. If you want […]

En Lire Plus

(Solution) : Angular 2+ DataTable / DIV to PDF File

if you want to generate a pdf file from datatable / Array or content in HTML Div : run this : 2. import : 3. create the datatable or the content to print in html div: 4. Create a button to generate PDF and put the as click action “generatePdf(contentToConvert)” 5. Finaly past this function […]

En Lire Plus

(SOLVED) How to convert an Object to Map values in TypeScript?

Problem : I need to convert an object to a map to get the values of key dynamically Solution : The Map constructor takes an array of key-value pairs. Object.entries is a new Object static method available in ES2017 (19.1.2.5) If you need to support older environments and transpilation is not an option for you, […]

En Lire Plus

Solution for : “execution of scripts is disabled on this system.”

Solution : execution of scripts is disabled on this system Go to Start Menu and search for “Windows PowerShell ISE”. Right click the x86 version and choose “Run as administrator”. In the top part, paste Set-ExecutionPolicy RemoteSigned; run the script. Choose “Yes”. Repeat these steps for the 64-bit version of Powershell ISE too (the non […]

En Lire Plus

(SOLVED) net::ERR_CONNECTION_REFUSED in Angular

net::ERR_CONNECTION_REFUSED : I’d like to access an API server, but the server hasn’t started. Then I got the error : Could I handle this according to the status of the response ? Solution 1 : Solution 2 : If you are using spring for the backend , just add the annotation @crossorigin in your rest controller to […]

En Lire Plus

(SOLVED) Typescript Sleep

In computer science, a thread of execution is the smallest sequence of programmed instructions that can be managed independently by a scheduler, which is typically a part of the operating system. If we need to sleep e thread, we can implements a delay method that returns a Promise object (which represents the eventual completion, or failure, of […]

En Lire Plus

TypeScript: map an objects collection into a different one

The map() method is helpful to creates a new array with the results of calling a provided function on every element in the calling array. Suppose that we have two classes: And we have an Angular service called ‘myService‘ that through a .getObjects() method returns the following data: If we need to fill a DestinationType array […]

En Lire Plus