Form with Custom Component does not recognize control

前端 未结 2 1955
暗喜
暗喜 2021-01-17 01:19

I am using a custom component (custom-text) which has the below code

    @Component({
      selector: \'custom-text, [custom-text]\',
      templateUrl: \'./         


        
2条回答
  •  悲哀的现实
    2021-01-17 01:39

    thinking about your problem really you needn't make a custom form component, just a component that pass as input the form control. Just add an Input

    @Input() control
    //And in .html
    
          
    
    

    You use the component like

提交回复
热议问题