Hi

I have a component which takes 2 input object, both are mandatory, the 
first one is used to generate to component, but the second one is there to 
store the data generated inside the component but I would like the property 
to be automatically generated if was undefined.

<myComponent [formQuestion]="formQuestions" 
[(formAnswer)]="currentElement.answer[formQuestions.id]"></myComponent >

The second input "formAnswer" is a dynamic property of an object 
"currentElement" in my parent controller. I would like the element to be 
automatically created, if undefined, from within the child component. Is 
there any way to achieve this. It seems ngModel is able to create simple 
properties automatically but I didn't manage to do so, in my child 
component when I manually initialise the second input, it's not available 
it my parent component (currentElement.answer[formQuestions.id] is still 
undefined while in the child component everything is OK)

Thanks for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to