Skip to content

Instantly share code, notes, and snippets.

@wKoza
Last active June 11, 2017 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wKoza/47f046117b1b98ef351f6b17739cc665 to your computer and use it in GitHub Desktop.
Save wKoza/47f046117b1b98ef351f6b17739cc665 to your computer and use it in GitHub Desktop.
import {Component} from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div [align]="alignement" [ngStyle]="{color:couleur}">Personne : {{person}} | Age : {{age}} | Adresse : {{address.street}}</div>
<app-comp1 [monAdresse]="address"></app-comp1>
<button (click)="modifierPersonne()">Modifier personne</button>
`
})
export class AppComponent {
person: string= 'John Doe';
age: number= 30;
address: any= {street: 'rue du Paradis', city: '75010 Paris'};
alignement: string = 'right';
couleur: string = 'red';
modifierPersonne() {
this.person = 'Another man';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment