TypeScript JavaScript dialog : If you need a JavaScript or TypeScript alert “dialog” to offer “yes” and “no” options, you can use the following solution : Read also : how to set checkbox element from TypeScript ?
Articles taggés:TypeScript JavaScript
(SOLVED) How to convert a string to number in TypeScript ?
How can we convert a string representation of a number, to number type in TypeScript ? Solution of string to number in TypeScript Like in JavaScript, we can use the parseInt or parseFloat functions, or simply use the unary + operator : Read also : Convert String to int in Java

(SOLVED): how to sleep a thread on TypeScript?
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 […]

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, […]

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 […]