Skip to content

Instantly share code, notes, and snippets.

@tiagolpadua
Created July 24, 2021 01:22
Show Gist options
  • Save tiagolpadua/45077705431ec7e798205f00550acd26 to your computer and use it in GitHub Desktop.
Save tiagolpadua/45077705431ec7e798205f00550acd26 to your computer and use it in GitHub Desktop.
cmail-card
<h3>{{cabecalho}}</h3>
<p>
{{corpo}}
</p>
<h5>{{rodape}}</h5>
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'cmail-card',
templateUrl: './cmail-card.component.html',
styles: [
]
})
export class CmailCardComponent implements OnInit {
@Input()
cabecalho = '';
@Input()
corpo = '';
@Input()
rodape = '';
constructor() { }
ngOnInit(): void {
}
}
<p>login works!</p>
<cmail-card [cabecalho]="aluno1.nome" [corpo]="aluno1.cargo" [rodape]="aluno1.disciplina">
</cmail-card>
<hr>
<cmail-card [cabecalho]="aluno2.nome" [corpo]="aluno2.cargo" [rodape]="aluno2.disciplina">
</cmail-card>
<hr>
<cmail-card [cabecalho]="aluno3.nome">
</cmail-card>
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {
aluno1 = {
nome: "João",
cargo: "Estudante",
disciplina: "Fisica"
}
aluno2 = {
nome: "Carlos",
cargo: "Professor",
disciplina: "Engenharia"
}
aluno3 = {
nome: "Raul"
}
constructor() { }
ngOnInit(): void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment