Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 我有一个textarea父组件,我想使用@input更改子组件中textarea的高度_Angular - Fatal编程技术网

Angular 我有一个textarea父组件,我想使用@input更改子组件中textarea的高度

Angular 我有一个textarea父组件,我想使用@input更改子组件中textarea的高度,angular,Angular,在子组件中访问时,如何更改textarea组件的大小 textarea.html <textarea style = "height"=150px></textarea> // height is set globally here //高度在此处全局设置 xyz.html <app-textarea></app-textarea> // want to change the height of text area in this compon

在子组件中访问时,如何更改textarea组件的大小

textarea.html

<textarea style = "height"=150px></textarea> // height is set globally here
//高度在此处全局设置
xyz.html

<app-textarea></app-textarea> // want to change the height of text area in this component value set globally cant be change
//要更改此组件值集中文本区域的高度,全局无法更改

在textarea组件中定义一个输入属性,该属性将包含textarea的高度:
@input()textareaHeight:string

在textarea.html中执行:
。有关ngStyle的更多信息:


在xyz.html中,在textarea组件中定义一个输入属性,该属性将包含textarea的高度:
@input()textareaHeight:string

在textarea.html中执行:
。有关ngStyle的更多信息:

在xyz.html中: