I'm trying to build a comment system that is using a RESTful service and AngularJS as frontend. The goal is to be able to simply add the comment system to any existing page. Here is what I've created so far to make this possible:
<div ng-controller="commentsController" class="comments-widget"> <wa-comments model="CmsPage" id="823"></wa-comments> </div> You simply pass a model and an ID to the comment widget and it loads everything else up. This works, so far so good. Now my problem starts when I want to add "reply to this comment" forms. The form should be injected somewhere in the DOM tree after the comment I want to reply to, similar to how Youtube does it. What is architecture wise the best approach for that? I'm trying to contain the whole widget inside a "main" directive called "waComments". I would like to try to have the most code inside this directive. An idea I had was to inject the form on click using another template. But how can I make sure that my directives scope sees the new forms? Also how do I inject the HTML? Clearly not from my controller. I thought about creating yet another directive but is my waComments directive able to access the scope of directives below? I'm explicitly not asking for code but for some help on how to build the the best possible way. -- 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.
