Hi Scott,
I can come up with at least 5 different ways of doing what you ask for.
That's probably even a low estimate. I need to know a bit more to give you
a way that suits your actual needs, way of working.
But I set up a simple sample for you. You can see it running here
<https://nbwixpva.github.stackblitz.io/requiredAttributes>
export class WaitForItComponent {
@Input() set prop1(val) { val && this.setIt('prop1', val); }
@Input() set prop2(val) { val && this.setIt('prop2', val); }
@Input() set prop3(val) { val && this.setIt('prop3', val); }
requiredProps = [];
goodToGo$ = new Subject<any[]>();
setIt(propName: string, value: string) {
this.requiredProps.push({ propName, value });
if (this.requiredProps.length === 3) {
this.goodToGo$.next(this.requiredProps);
}
}
}
For me, this strikes a nice balance between easy to maintain and
complexity. the complete sample can be found here.
Is this what you are looking for?
Regards
Sander
--
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 [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.