Skip to content

Instantly share code, notes, and snippets.

@nicholasess
Created May 23, 2018 17:53
Show Gist options
  • Save nicholasess/ea8413c5a92d115c50519c64bddcffcd to your computer and use it in GitHub Desktop.
Save nicholasess/ea8413c5a92d115c50519c64bddcffcd to your computer and use it in GitHub Desktop.
<div>
<md-content class="md-padding">
<div>
<form name="reviewsForm">
<div layout="row">
<md-input-container>
<label for="reviewsFormCustomers">Cliente</label>
<md-select id="reviewsFormCustomers" ng-model="reviewsFormModel.customer" ng-change="selectedCustomer(reviewsFormModel.customer)">
<md-option ng-repeat="customer in customers" ng-value="customer._id">
{{ ::customer.name }}
</md-option>
</md-select>
</md-input-container>
</div>
<div layout="row">
<md-input-container ng-if="establishments">
<label for="reviewsFormEstablishments">Estabelecimento</label>
<md-select id="reviewsFormEstablishments" ng-model="reviewsFormModel.establishmentId">
<md-option ng-repeat="establishment in establishments" ng-value="establishment._id">
{{ ::establishment.name }}
</md-option>
</md-select>
</md-input-container>
</div>
<div ng-if="reviewsFormModel.establishmentId">
<div layout="row">
<md-input-container>
<label>Quem avaliou?</label>
<input ng-model="reviewsFormModel.reviewer" type="text">
</md-input-container>
</div>
<div layout="row">
<md-input-container>
<label for="reviewsFormRating">Qual a nota?</label>
<input ng-model="reviewsFormModel.rating" type="number" min="1" max="5">
</md-input-container>
</div>
<div layout="row">
<md-input-container>
<label for="reviewsFormSource">Qual a fonte?</label>
<input ng-model="reviewsFormModel.source" type="text">
</md-input-container>
</div>
<div layout="row">
<md-input-container>
<label>Qual a data?</label>
<md-datepicker ng-model="reviewsFormModel.date"></md-datepicker>
</md-input-container>
</div>
<div layout="row">
<md-input-container>
<label for="reviewsFormReview">Review</label>
<textarea ng-model="reviewsFormModel.text" rows="5" md-select-on-focus></textarea>
</md-input-container>
</div>
</div>
<button type="submit" class="btn btn-default" ng-click="submit()">
Submit
</button>
</form>
</div>
</md-content>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment