Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

refresh page angular

refresh(): void {
    window.location.reload();
}
Comment

How to Reload a Component in Angular

reloadComponent() {
  let currentUrl = this.router.url;
      this.router.routeReuseStrategy.shouldReuseRoute = () => false;
      this.router.onSameUrlNavigation = 'reload';
      this.router.navigate([currentUrl]);
  }
Comment

refresh current component angular

  reloadCurrentRoute() {
    let currentUrl = this._router.url;
    this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
        this._router.navigate([currentUrl]);
        console.log(currentUrl);
    });
  }
Comment

angular reload component

reloadCurrentRoute() {
    let currentUrl = this.router.url;
    this.router.navigateByUrl('/', {skipLocationChange: true}).then(() => {
        this.router.navigate([currentUrl]);
    });
}
Comment

refresh angular

@Component({
	selector: 'app-root',
	templateUrl: './app.component.html',
	styleUrls: ['./app.component.css']
})
export class AppComponent {
	title = 'refreshPage';
	constructor(public _router: Router, public _location: Location) { }
	refresh(): void {
		this._router.navigateByUrl("/refresh", { skipLocationChange: true }).then(() => {
		console.log(decodeURI(this._location.path()));
		this._router.navigate([decodeURI(this._location.path())]);
		});
	}
}
Comment

how to make a component reload in angular

DeleteEmployee(id:number)
  {
    this.employeeService.deleteEmployee(id)
    .subscribe( 
      (data) =>{
        console.log(data);
        this.ngOnInit();
      }),
      err => {
        console.log("Error");
      }   
  }
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular goto top of page 
Javascript :: base64 to png nodejs 
Javascript :: transitionduration 
Javascript :: how to divide array in chunks 
Javascript :: jquery check if type is checkbox 
Javascript :: get child routes using parent in angular 
Javascript :: test undefined js 
Javascript :: isarray 
Javascript :: how to set current date and time in jquery datetime-local 
Javascript :: json rename key 
Javascript :: how to fetch api in reactjs using axios 
Javascript :: scrollview refresh 
Javascript :: find the max length of string elements in an array 
Javascript :: javascript date get future 15 minutes 
Javascript :: react counter input 
Javascript :: iterate object js 
Javascript :: css div at bottom of div 
Javascript :: new jsonobject java 
Javascript :: js classlist 
Javascript :: get value by name array from select in jquery 
Javascript :: get cursor position in contenteditable div 
Javascript :: difference between == and === in javascript 
Javascript :: putting a loop into an array javascript 
Javascript :: encodeuricomponent js 
Javascript :: change property name of object in array javascript 
Javascript :: click outside javascript 
Javascript :: Binary Agents 
Javascript :: reverse geocoding javascript map 
Javascript :: how to convert milliseconds to time in javascript 
Javascript :: insert into specific array index 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =