Friday, September 27, 2019

CSS transitions play nicely with promises returning in Angular applications.

The transition will kick in once you call this method signaling a change in H1 tag text and drawing the user's eye.

findNameOfLatestFile(templateVersionMode:TemplateVersionModel) {
   this.titleTag.nativeElement.innerHTML = templateVersionMode.FileName;
   this.titleTag.nativeElement.classList.add("transition");
}

 
 

Going forward, whenever you call whatever might return the promise a second time, you should have just upstream of that act:

if (this.titleTag.nativeElement.classList.length == 1) {
   this.titleTag.nativeElement.classList.remove("transition");
}

No comments:

Post a Comment