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 […]
Articles taggés:Angular
Solution for : Angular 2+ how to set min or max date in input type date
Angular how to set min or max date in input type date ? How to set date input field’s max date to today ? Solution : You have to add this your TS file : Then in your template you add : Source

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

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

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 […]
Disable Input fields in reactive form from type Script
Disable Input fields in reactive form from type Script If you want to disable some input of your formBuilder from the TS File , you can use this code : Or
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 […]
Solution for : TypeScript – Get difference between two dates in days
if you need to get the difference between two dates in days. you can use this function : if you are using the date as a String you can have this error getTime() is not a function ! so if you have this error try this solution
Solution for : How to have a default option in angular 2+
Problem How to have a default option using angular 2 ou plus ? Solution if you have a select and you want to set a default value using angular , Add a binding to the selected property, like this : Read also : How to click on html button from the type script file in […]
Solution for : Select default option value from typescript angular
Problem if i have this code : How can I select the default value from typescript for example 45 ? Solution You can do this :
How to click on html button from the type script file in Angular 2 ?
How to click on html button from the type script file in Angular 2 ? Some time we need to click into a button from the ts File to run one action, to do this you can try this solution (even if it is a hidden button) : Solution : On ts File use the […]
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 […]
How to get the current year using typescript in angular 6
current year angular 6 : Try this code :
Solution for : Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’
Can’t bind to ‘formGroup’ since it isn’t a known property of ‘form’ The solution of this problem is : import FormsModule and ReactiveFormsModule in your module. Lire aussi : Solution for : No Provider for FormBuilder
Déploiement d’une application Web avec Angular 7 et Spring Boot 2
Déploiement de l’application dans Tomcat Cette partie de l’article va se consacrer à la présentation du déploiement, sur un système d’exploitation Windows, de notre application Library (front-end et back-end) dans un serveur d’application, en l’occurrence Tomcat. Le déploiement que nous présenterons ici suivra un processus manuel, mais représente très exactement ce que des outils d’intégration […]