I'm playing around with my first angular app. I'm super happy with how easy it is.I am making an app with a list of characters on the left, and a new/edit form on the right. When the user clicks on a character, I want it to populate the form with the characters info.First, I had the form request the character by id from the server. That works fine, but I don't want to make that call to the server. I already have all the data in the list. I want to pass it in.Second, I had the list update a .selected variable on a service shared between the list and the form. That worked fine, but I lost deep linking.Third, I got the router to control the selection, but it has to re-initialize the list controller each time they click, which calls the server to get the whole list.(Current = Third take) https://gist.github.com/2996792How can I make the form use the list, without sending any new requests, and still get the router to work?Thanks!~sean--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/7wsnjCggjkUJ.
To post to this group, send email to ang...@googlegroups.com.
To unsubscribe from this group, send email to angular+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/angular?hl=en.
Hi John, we keep running into each other :)Ok, so I let it re-initialize the controller, but since it re-injects the same wrapper as before, I can have it intelligently decide NOT to re-request the data. Cool. That's a good idea.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/VZ4zsqWC7a8J.
This is useful. I wonder, this seems like such a common use case, are there any examples, or other sources on this.
On Tuesday, 26 June 2012 19:57:51 UTC+2, John Lindquist wrote:
Right. I prefer to think of angular controllers as dumb apis/configs for my views and leave all the heavy lifting to services. I think everyone will have their own opinions as to the balance between relying on $scope, separation of services, defining tons of directives, etc.
On Tue, Jun 26, 2012 at 11:20 AM, Sean Hess <> wrote:
Hi John, we keep running into each other :)Ok, so I let it re-initialize the controller, but since it re-injects the same wrapper as before, I can have it intelligently decide NOT to re-request the data. Cool. That's a good idea.
--To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/VZ4zsqWC7a8J.
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group, send email to angular+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To view this discussion on the web visit https://groups.google.com/d/msg/angular/-/6pBSzPIqBNEJ.