That makes totally sense. thanks for the quick reply, but what I am trying to understand is when I have to save the rating (on user click).
Which is the way to proceed: 1. inject a service inside the directive and call the service.post directly ? 2. pass the values to the controller, maybe do some other stuff on top and then call the service injected in the controller? I was thinking on the second option but I have problems passing down the value of the rating to the controller, when the user clicks (without using a $broadcast and maybe calling just one function in the controller) Thanks Lucian On Thursday, April 3, 2014 6:59:20 AM UTC+2, Sander Elias wrote: > > Hi Lucian, > > Your directive has an isolate scope. If you isolate the scope, it will > inherit nothing from it's parents. So, scope.save will not be available! > > Also I don't see anything in your code that makes it need the $compile. > Just use you function to make the template. > Ditch the for loop in your function and use ng-repeat. You are making it > way more complex than it needs to be. > > Hmm, let me just show you: > http://plnkr.co/edit/SIcXRTgS12NTmyvyUccR?p=preview > > Regards > Sander > -- 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.
