Skip to content

Instantly share code, notes, and snippets.

@t301000
Created June 3, 2017 08:42
Show Gist options
  • Save t301000/087e32729de1ef63752f8d44c300ef27 to your computer and use it in GitHub Desktop.
Save t301000/087e32729de1ef63752f8d44c300ef27 to your computer and use it in GitHub Desktop.
20170531 作業實做參考
<div class="color"
[ngStyle]="{'background-color': myStyle}"
(click)="picked.emit(myStyle)"></div>
<div *ngIf="show; else edit" class="tweak">
<input type="range" min="0" max="255" [(ngModel)]="r">
<span style="color: red">{{ r }}</span><br />
<input type="range" min="0" max="255" [(ngModel)]="g">
<span style="color: green">{{ g }}</span><br />
<input type="range" min="0" max="255" [(ngModel)]="b">
<span style="color: blue">{{ b }}</span><br />
<button (click)="show = false">Close</button>
</div>
<ng-template #edit>
<button (click)="show = true">Edit</button>
</ng-template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment