¿Cómo conecto el botón para cambiar los valores de los valores [codeOnly] en las directivas debajo de él?
Estoy usando Angular 2.4.10 en mecanografiado.
<button class="btn btn-primary"> Click me to change all of the [codeOnly] values below to true </button> <app-header [codeOnly]='false'></app-header> <app-power-bi-wrapper [codeOnly]='false'></app-power-bi-wrapper> <app-power-bi-wrapper-mobile [codeOnly]='false'></app-power-bi-wrapper-mobile> <app-page-title [codeOnly]='false'></app-page-title> <app-page-title-nav [codeOnly]='false'></app-page-title-nav>En el componente que contiene su HTML agregue
isFoo:boolean = false;luego cambie el HTML a
<button class="btn btn-primary" (click)="isFoo = true" > Click me to change all of the [codeOnly] values below to true </button> <app-header [codeOnly]='isFoo'></app-header> <app-power-bi-wrapper [codeOnly]='isFoo'></app-power-bi-wrapper> <app-power-bi-wrapper-mobile [codeOnly]='isFoo'></app-power-bi-wrapper-mobile> <app-page-title [codeOnly]='isFoo'></app-page-title> <app-page-title-nav [codeOnly]='isFoo'></app-page-title-nav>o para alternar
<button class="btn btn-primary" (click)="isFoo = !isFoo" > Click me to change all of the [codeOnly] values below to true </button>