【发布时间】:2019-01-09 10:09:16
【问题描述】:
我有 2 个不同的 html 文件,
test1.html test2.html test2.component.ts
1) test1.html:
<div style="width:100%;height:20%"></div>
2) test2.html :
如果我点击矩形函数,test1.html 的边框半径应该变为 0px。
如果我点击roundCorder函数,test1.html边框半径应该变成10px;
<img (click)="rectangle()" [src]="imgSrc" (mouseover)="rectangleHover()" (mouseout)="rectangleOut()" style="height:100px;float:left;margin:15px;" >
<img (click)="roundCorner()" [src]="imgSrc1" (mouseover)="roundHover()" (mouseout)="roundOut()" style="height:100px;float:left;margin:15px;">
3) test2.components.ts :
roundCorner(){
// want to change test1.html file div border radius as 10px;
}
【问题讨论】:
-
到目前为止你尝试了什么?
-
提示:使用 [style.border-radius]="what ever"
-
基于条件@Eliseo
-
尝试一下并编辑问题。我不知道您是否有一个、两个或三个组件,或者您的问题是组件之间的通信还是只是绑定 [style.property]。对不起,我不能再这样做了
标签: html css angular angular5 angular6