0
@Component({
  selector: 'app-ip-ill',
  templateUrl: './ip-ill.component.html',
  styleUrls: ['./ip-ill.component.css'],
  providers: [FormComponent]
})

Can i add FormComponent as provider in my Other component and access variable values from FormComponent?

ImRaN JB
  • 1
  • 6
  • what is the reason for making your component as provider ? – balajivaishnav Jun 26 '18 at 14:18
  • No need to add it in provider you are able to inject any parent component, but please do take care how you wanna get the instance of that component with special injector decorators such @Optional() or @SkipSelf() – Abinesh Devadas Jun 26 '18 at 14:19

0 Answers0