Skip to content

Instantly share code, notes, and snippets.

@ellismarte ellismarte/k.html Secret
Last active Oct 6, 2016

Embed
What would you like to do?
<div class="newproduct-form" ng-controller="NewProductController">
<form class="container-fluid">
<div class="row">
<input type="file" name="fileupload" accept="image/*" id="fileupload" ng-model="vm.photo">
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="category">Category</label>
<input type="text" class="form-control" ng-model="vm.category" placeholder="Shoes">
</div>
<div class="form-group col-md-6">
<label for="price">Price</label>
<input type="text" class="form-control" ng-model="vm.price" placeholder="100.00">
</div>
</div>
<div class="row">
<div class="form-group col-md-4">
<select class="currency" ng-model="vm.currency">
<option>USD</option>
</select>
</div>
<div class="form-group col-md-4">
<label for="quantityavailable">Quantity Available</label>
<input type="number" class="form-control" ng-model="vm.quantityavailable" placeholder="4155551234">
</div>
<div class="form-group col-md-4">
<label for="style">Style</label>
<input type="text" class="form-control" ng-model="vm.style" placeholder="Business casual">
</div>
</div>
<button type="submit" class="btn btn-primary" ng-click="vm.submit()">Submit</button>
</form>
</div>
export default class NewProductController {
constructor($scope, $http, datastore){
'ngInject';
this.scope = $scope;
this.http = $http;
this.config = {"withCredentials": true, "Access-Control-Allow-Origin": true};
this.account = datastore.retrieve("account");
this.store = null;
this.allGroups = {"westcoast": "admin", "eastcoast": "admin"};
this.groups = [];
this.accountandstore = null;
this.id = null;
this.photo = null;
this.category = null;
this.url = null;
this.price = null;
this.currency = null;
this.quantityavailable = null;
this.properties = null;
this.style = null;
}
submit(){
console.log(this.photo)
console.log(this.category)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.