Advertisement
fmunoz92

Untitled

Sep 15th, 2014
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $scope.create = function(isValid) {
  2.       if (isValid) {
  3.         var article = new Articles({
  4.           title: this.title,
  5.           content: this.content
  6.         });
  7.         article.$save(function(response) {
  8.           $scope.articles.push(response);
  9.         });
  10.  
  11.         this.title = '';
  12.         this.content = '';
  13.       } else {
  14.         $scope.submitted = true;
  15.       }
  16.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement