Skip to content

Instantly share code, notes, and snippets.

View wKoza's full-sized avatar
🌏
A new opportunity ? hmmm why not

William Koza wKoza

🌏
A new opportunity ? hmmm why not
  • Self-employment
  • France
View GitHub Profile
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div align="{{alignement}}" >Personne : {{person}} | Age : {{age}} | Adresse : {{address.street}}</div>
`
})
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<div [align]="alignement" [ngStyle]="{color:couleur}">Personne : {{person}} | Age : {{age}} | Adresse : {{address.street}}</div>
`
})
<div *ngIf="1 > 0"> Afficher la div</div>
<template [ngIf]="1 > 0">
<div> Afficher la div</div>
</template>
<div [ngStyle]="{color:'red'}">Learn Angular</div>
import { Directive } from '@angular/core';
@Directive({
selector: '[appHighlight]'
})
export class HighlightDirective {
constructor() { }
}
<div appHighlight>Texte en hightlight</div>
<div [appHighlight]="'yellow'">Texte en highlight</div>
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>
`
})
export class AppComponent {
import {Component, Input} from '@angular/core';
@Component({
selector: 'app-comp1',
template: `
{{monAdresse.street}}
`
})
export class Comp1Component {