[英]How to apply style to child component from parent component when we have 2 child component
[英]how to Use a variable that we imported from parent component with @input in the child html component using {{ }}
這是我的子組件.ts文件:
import { Component, OnInit,Input } from '@angular/core';
import { IProduct } from '../product/produit';
@Component({
selector: 'app-zoomdetails',
templateUrl: './zoomdetails.component.html',
styleUrls: ['./zoomdetails.component.css']
})
export class ZoomdetailsComponent implements OnInit {
**@Input() produit : String;**
}
這是我要使用“產品”變量的地方
<div class="col-md-6" style="border:0px solid rgba(163, 152, 152, 0.856)">
<span class="pull-right">
<!-- Datos del vendedor y titulo del producto -->
***<h1>{{produit}} </h1>***
<h4 style="color:#337ab7"> Daniel Keyes <small style="color:#337ab7">(50 ventes)</small></h4>
任何幫助plzzzzz
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.