I recall either reading a blog entry or watching a video where it was 
recommended to pass the form data into the controllers submit function 
instead of tying it directly to the controllers scope. I see it being done 
by Matias in Taming Forms in AngularJS 1.3 
<http://www.yearofmoo.com/2014/09/taming-forms-in-angularjs-1-3.html> where 
his form submit function looks like:

    ngModule.controller('FormCtrl', function($http) {
      this.submit = function(isValid, data) {
        if(!isValid) return;
    
        //submit the data to the server
        $http.post('/api/submit', data);
      }
    });

I know I have either read or watched something where it explained the 
reasoning behind it, but I can't recall where or find it in my favorites. 
I'm hoping somebody recalls this too and can point me in the right 
direction.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to