Importante

martes, 2 de mayo de 2023

interpolacion

 permite colocar texto enytre html y atributos

se puden colocar textp atributos como 


<p>{{ title }}con Gersom Cedeño</p>
<p>total: {{ 5 + 5}}</p>

el resultado sería:

retoD1 con Gersom Cedeño

 total : 10


se puede usar tambien dentro de los atributos


import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  title = 'retoD1';
  url = 'https://pixabay.com/es/images/search/imagen/';
}

y en su html coloco 

<img src="{{ url }}" alt="">













0 comentarios:

Publicar un comentario