Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gparlakov/52fdec6373a8c7e2c130ccb761a4db4d to your computer and use it in GitHub Desktop.

Select an option

Save gparlakov/52fdec6373a8c7e2c130ccb761a4db4d to your computer and use it in GitHub Desktop.
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;}",
"::ng-deep.pi.pi-times {color: red}"] // style the close icon
})
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