javascript - Angularjs filter: get attribute 'name' by ID -
in html have following.
<div class="form-group"> <label class="col-sm-2 control-label">select plate:</label> <div class="col-sm-5"> <select class="form-control m-b-sm" id="plateid" ng-change="getselectedplate(selectedplate.item)" ng-model="selectedplate.item" ng-options="plate (plate.id + ' - ' + plate.serial_number) plate in plates" required="true" /> <option value=" ">----------</option> </select> </div> </div>
upon selection of plate. have ng-model retrieves plate-type id well.
<div class="form-group"> <label for="input-readonly" class="col-sm-2 control-label">project name: </label> <div class="col-sm-5"> <input type="text" class="form-control" id="input-readonly" value="{{selectedplate.item.plate_types_id.name}}" readonly> </div> </div>
now want instead of showing plate_types_id
show name of plate type.
i new angularjs , unable figure simple thing out. me appreciated.
Comments
Post a Comment