Skip to content

Instantly share code, notes, and snippets.

@SimonDoy
Created May 8, 2016 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimonDoy/8e7b90c7029897d74049c330d80adb6d to your computer and use it in GitHub Desktop.
Save SimonDoy/8e7b90c7029897d74049c330d80adb6d to your computer and use it in GitHub Desktop.
Invoice Controllers, "addInvoiceController"
invoiceControllersModule.controller('addInvoiceController', ['$scope', 'dataModelService', '$location', function($scope, dataModelService, $location){
$scope.invoice=new dataModelService.Invoice();
$scope.addInvoiceLine = function addInvoiceLine() {
var newInvoiceLine=new dataModelService.InvoiceLine();
$scope.invoice.invoiceLines.push(newInvoiceLine);
}
$scope.cancel = function cancelStub(){
$location.path('/');
}
$scope.status = "";
$scope.error="";
$scope.saveInvoice = function saveInvoiceStub(){
$scope.status="Successfully Saved Invoice";
$location.path("#");
return true;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment