Skip to content

Instantly share code, notes, and snippets.

@anjanawijesundara
Created April 13, 2015 07:32
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 anjanawijesundara/a8232af91c2fa7c27c98 to your computer and use it in GitHub Desktop.
Save anjanawijesundara/a8232af91c2fa7c27c98 to your computer and use it in GitHub Desktop.
app.js Part three
app.controller ('CustomerAddControler',[
'$scope','$http','$location',
function ($scope, $http, $location) {
$scope.master = {};
$scope.activePath = null;
$scope.New_Customer = function(customer, AddNewForm) {
console.log(customer);
$http.post('api/New_Customer', customer).success(function(){
$scope.reset();
$scope.activePath = $location.path('/');
});
$scope.reset = function() {
$scope.customer = angular.copy($scope.master);
};
$scope.reset();
};
}
]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment