angular2 icon indicating copy to clipboard operation
angular2 copied to clipboard

Update app.html

Open davutg opened this issue 8 years ago • 1 comments

artist-details bothers whilst query. It looks better to hide it when there is a query expression.

davutg avatar Nov 04 '16 13:11 davutg

or using hidden directives

<artist-details [hidden]="query" *ngIf="currentArtist" [artist]="currentArtist">

or for auto reset search and hide artist-details if null :

//app.component.ts

export class AppComponent {

.....

public edited : boolean = false;

showArtist(item) : void{
    this.currentArtist = item;
    this.edited=false;
  }
resetSearch(item) : void{
    if(item != null){
      this.edited = true;
    }else{
      this.edited = false;
    }
}
<!-- app.html -->

<input [(ngModel)]="query" 
        (click)="resetSearch(query)"
        placeholder="type in search term">
</div>

...

<artist-details [hidden]="query" 
                *ngIf="currentArtist && edited==false" 
		[artist]="currentArtist">
</artist-details>

KingGeneral avatar Feb 09 '17 04:02 KingGeneral