I have a component
<p style="padding: 5px">
<select [(ngModel)]='thisDD' name="nameDD" id="idDD" (ngModelChange)="updateDD(thisDD)" class="form-control">
<option *ngFor="let thing of thingies" [value]="thing.thingID">{{thing.ThingName}} ({{thing.ThingCode}})</option>
</select>
</p>
Which has an @OutPut
@Output() selectedValue = new EventEmitter<object>();
And I use this in my app
<my-dropdown (selectedValue)="setValue($event)"></my-dropdown>
Which calls code in the component to "setValue"
setValue(event){
this.currValue=event;
}
This all works great when the value of the drop down is changed but I have other components that rely on a value being set when the application is loaded.
Is there a way to get the value I defaulted my component to through @Output? or how would you accomplish this?