How to refresh entire application when date is changed in angular 9 ? Last Updated : 17 Dec, 2020 Comments Improve Suggest changes Like Article Like Report In this example, we will see how to refresh the application when the date is changed in angularJS. Approach: First, we need to write the code for displaying the date picker in an HTML file.We can achieve this by giving the input type as the date.After completing the input type, we need to declare a function on the 'onchange' event so that whenever the date is changed or modified the application will be reloaded.After declaring the function in the HTML file we need to write the function implementation in the ts file.In the function implementation, we can use the window property of DOM, and we can call the reload function so that the application is reloaded.After completing the above steps, serve or start the project. Code Implementation: app.component.ts: JavaScript import { Component } from '@angular/core'; @Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { constructor() { } // Function to reload the application refreshPage() { window.location.reload(); } } app.component.html: HTML <h1>Hello User !</h1> <p>Change the date to refresh the application.</p> <input type="date" (change)="refreshPage()"> app.module.ts: JavaScript import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; @NgModule({ imports: [ BrowserModule, FormsModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } Output: Comment More infoAdvertise with us Next Article How to refresh entire application when date is changed in angular 9 ? B bunnyram19 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Misc Similar Reads How to auto-save data when application is offline in Angular 8? Auto-saving the data comes into action when your application needs to work offline and the CDN(content delivery network) will fail. In this article, we are going to access the required steps that are intended to save your application locally when offline and submit it once a connection has prevailed 5 min read How to detect a route change in AngularJS ? In this article, we will see how to detect a route change in AngularJS. In order to detect route change at any moment in AngularJS, this can be achieved by using the $on() method. The $on() method is an event handler, the event which will handle $routeChangeSuccess which gets triggered when route/vi 2 min read How to change the date format using AngularJS ? In this article, we will see how to change the date format using AngularJS. AngularJS provides 2 different ways to change the format of the date. It can be achieved by the following approaches: Using HTML Template BindingUsing JavaScript ControllerHTML Template Binding: In this method, we use the pi 3 min read How to use angular-calendar in Angular 17? Angular applications often require scheduling and event management features, which can be challenging to implement from scratch. Fortunately, Angular Calendar, a powerful library built specifically for Angular, provides the solution to this problem. In this article, we'll explore how Angular Calenda 2 min read How to Restrict User to Enter Date Manually in Date Field using AngularJS ? In this article, we will see how to restrict the user to enter the date manually in the date field using AngularJS, along with understanding its implementation through the example. Approach: First, we need to write the code for input, and we need to give its type as the date in the HTML file.Then in 2 min read How to build progressive web app(PWA) in Angular 9 ? In this article, we will develop a PWA (Progressive Web App) using Angular. What is PWA ? Progressive Web Apps (PWAs) are web applications that have been designed so that they are capable, reliable, and installable. PWA are built and enhanced with modern APIs to deliver enhanced capabilities, reliab 7 min read How Single Page Applications work in Angular ? In traditional web applications, each time a user interacts with a website, the server sends a new HTML page back to the browser. This process can be slow and inefficient, resulting in a less-than-optimal user experience. Single Page Applications (SPAs) solve this problem by loading all necessary re 7 min read How To Share Data Between Child And Parent Directives And Components In Angular? Sharing data between child and parent components in Angular is important for building dynamic and interactive applications. This can be done through various concepts, including input and output bindings or using a shared service. This article will explore how to use an Angular service to enable data 5 min read How to Create Observable data stream using fromEvent method in AngularJS ? In this article, we will learn how Observable supports data sharing between publishers and subscribers in an angular application. An Observable is referred to as a better technique for event handling, asynchronous programming, and handling multiple values as compared to techniques like promises.Obse 6 min read How to create module with Routing in Angular 9 ? Angular applications are modular, and NgModules is Angular's own modular architecture. NgModules are containers for closely integrated application domains, workflows, or feature sets that comprise cohesive code blocks. Their scope is governed by the NgModule they include, and they can contain compon 4 min read Like