What is impure pipe in Angular ?

I am unable to understand impure pipes, some what better with pure pipes. Please explain with a simple and basic example ? Anser : A pure pipe is only called when Angular detects a change in the value or the parameters passed to a pipe. An impure pipe is called for every change detection cycle no matter […]

En Lire Plus

Solution for : 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

ANGULAR 9 : NOUVELLE VERSION ET AMÉLIORATIONS DU FRAMEWORK

Google est vraiment en train de se rattraper et a réussi à stabiliser le framework Angular (On se souvient de la catastrophe entre Angular 1 et Angular 2). Une chose est quasiment sûre, c’est qu’avec une nouvelle version tous les 6 mois, Google annonce clairement son intention de faire d’Angular un framework stable et mature. […]

En Lire Plus

TypeScript : how to sleep a thread ?

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 an asynchronous operation, and its resulting value) and through the setTimeout method (that sets a timer which executes a function or specified piece of code once after the timer expires) resolve […]

En Lire Plus

Angular : HTML to PDF with htm2canvas and jsPDF

Angular HTML to PDF htm2canvas jsPDF : Sometimes we need to export our HTML page into a PDF file. So how can we do this? There are two helpful tools that we can use to do this. The first is jsPDF that help us to produce a PDF file from an HTML content. The following is the […]

En Lire Plus

Asp Net Core 2 – Angular: download file from Controller

If we have an Angular client app that needs to download a file (for example a PDF file) from an Asp Net Core 2 api Controller , we can follow what is described in this post. The first implementation is on the server side (an Asp Net Core 2 Controller). So, for example into our controller UserController, […]

En Lire Plus

Type Script : sum of object properties within an array

If we need to sum a simple array, we can use the reduce method, that executes a reducer function (that you provide) on each member of the array resulting in a single output value. For example: But if we have an objects array like the following: We need to use the map method (that creates a new array […]

En Lire Plus

Angular – routing with multiple query parameters

The Angular Router enables navigation from one view to the next as users perform application tasks. If we need to pass one or more query string parameters to our next view component, we need to divide our parameters into the routing path with ‘/:’ For example, our app.routing.ts should contains: And into the ngOnInit() method of the HomeComponent.ts […]

En Lire Plus

Solution for : getTime() is not a function ?

getTime() is not a function : if you are using the function getTime() and you have the error getTime() is not a function (in javascript / Typescript ) that mean you are using the date as a String , so as a solution you must parse the Date. for that you can use this function […]

En Lire Plus

How to convert date into this ‘yyyy-MM-dd’ format in angular 2

If you want to convert current data into ‘yyyy-MM-dd’ format in .ts file. just see this tuto : In template: (.html) in typescript: (.ts) The date can be converted in typescript to this format ‘yyyy-MM-dd’ by using Datepipe and just add Datepipe in ‘providers’ array of app.module.ts. Like this: Read also : How to get […]

En Lire Plus