Skip to content

Commit 7138f13

Browse files
committedAug 5, 2021
ocr : Propriétés personnalisées, i had an error TS2564 so i used !
1 parent 9d1fd9a commit 7138f13

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed
 

‎src/app/app.component.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<div class="col-xs-12">
44
<h2>Mes appareil</h2>
55
<ul class="list-group">
6-
<app-appareil></app-appareil>
7-
<app-appareil></app-appareil>
8-
<app-appareil></app-appareil>
6+
<app-appareil [appareilName]="appareilOne" [appareilStatus]="'éteint'"></app-appareil>
7+
<app-appareil [appareilName]="appareilTwo" [appareilStatus]="'allumé'"></app-appareil>
8+
<app-appareil [appareilName]="appareilThree" [appareilStatus]="'éteint'"></app-appareil>
99
</ul>
1010
<button class="btn btn-success"
1111
[disabled]="!isAuth"

‎src/app/app.component.ts

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { Component } from '@angular/core';
88
export class AppComponent {
99
isAuth = false;
1010

11+
appareilOne = 'Machine à laver';
12+
appareilTwo = 'Frigo';
13+
appareilThree = 'Ordinateur';
14+
1115
constructor() {
1216
setTimeout(
1317
() => {

‎src/app/appareil/appareil.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { Component, Input,OnInit } from '@angular/core';
22

33
@Component({
44
selector: 'app-appareil',
@@ -7,8 +7,8 @@ import { Component, OnInit } from '@angular/core';
77
})
88
export class AppareilComponent implements OnInit {
99

10-
appareilName: string = 'Machine à laver';
11-
appareilStatus: string = 'éteint';
10+
@Input() appareilName!: string;
Has a conversation. Original line has a conversation.
11+
@Input() appareilStatus!: string;
1212
constructor() { }
1313

1414
ngOnInit(): void {

0 commit comments

Comments
 (0)
Please sign in to comment.