Created
March 10, 2019 13:58
-
-
Save gparlakov/0bad4749bd707670ca93166b73e255fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, ViewEncapsulation } from '@angular/core'; | |
| @Component({ | |
| selector: "gp-button2", | |
| template: ` | |
| <button class="button" (click)="onToggleDialogClick()"> | |
| Show dialog | |
| </button> | |
| <p-dialog header="Title" [(visible)]="visible"> | |
| This is the dialog content | |
| </p-dialog> | |
| `, | |
| styles: [".button { background-color: cyan;}", | |
| ".pi.pi-times {color: red}"], // style the close icon | |
| encapsulation: ViewEncapsulation.None // we need this | |
| }) | |
| export class Button2Component { | |
| visible = false; | |
| onToggleDialogClick() { | |
| this.visible = !this.visible; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment