angular-ui / AngularJS-StyleGuide

Example of scalable architecture for my NG-Conf 2014 talk
http://www.youtube.com/watch?v=Iw-3qgG_ipU
284 stars 53 forks source link

Handling the submitting of a form #11

Closed marcfallows closed 10 years ago

marcfallows commented 10 years ago

So, I've been playing around with the concept of ORM in an AngularJS app and basing some ideas around your presentation. But, I've hit a bit of a roadblock.

I would expect we would want to do the following in our form.html for adding a form:

<form ng-submit="project.save()">

Taking advantage of the functionality that exists in the model, and not the controller.

But, I don't get how you would clear that project (create a new Project() to be used in the form for adding a project), or change the route back (to say the projects state), as a result of the submit without instead handling it as a method on the controller?

Or, am I taking the concept too far, and in this case it is the type of thing still meant to be handled in the controller (say, ProjectFormController)?

ProLoser commented 10 years ago

Check out #8

marcfallows commented 10 years ago

Ah, shoot. missed that existing issue. Thanks for the quick response.