Hi You could inject the parent component into the child component and read from/write to to parent component's controller:
@component() class Parent {} @Component() class Child { constructor(private parent: Parent) {} } *Bastien Lemaire* On Wed, 29 Jul 2020 at 12:38, Andrea Zanti <plusmeninbr...@gmail.com> wrote: > Hi everyone, > I have a parent component in which i define a logic. The child component > instead is always the same and it receives always the same props from the > parent. > I explain better. Here an example: > > > <parent-component> > <child-component prop1="prop1" prop2="prop2" ...... again> > </child-component> > </parent-component> > > Form my instance: > > <app-login> > <app-form > [form]="form" > [model]="model" > [fields]="fields" > [submit]="submit.bind(this)" > [url]="url"> > </app-form> > </app-login> > > N.B: All the props passed on the app-form component are defined in the > parent component ( They are alway the same!!) > > App form is like a placeholder for the form , logic is always the same: it > sends the request to the api , and handles error showing them in the inputs > (inline error-forms). > The parent component defines the html thanks to the ng-formly package, and > define behaviour after the submit. > > > *Now i want to know if is possible to avoid to redefine everytime all the > props.* > *Something like getting all useful props from parent.* > > *The final result should be like this: * > > <app-login> > <app-form > </app-form> > </app-login> > > > Thanks in advance! > > -- > You received this message because you are subscribed to the Google Groups > "Angular and AngularJS discussion" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to angular+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/angular/a0f494e6-bf85-4eaf-a389-d769ede82a68n%40googlegroups.com > <https://groups.google.com/d/msgid/angular/a0f494e6-bf85-4eaf-a389-d769ede82a68n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/CAJ7E9zGRurLW%2B%3DEwstuEMj2vZ8B9Wb2uJkyAkkmQ%3DfTH288SdA%40mail.gmail.com.