Hi,
using services in directives is very simple, just inject them and
that's it. It seems your question evolves to: is it possible to
construct a template inside directive involving a service. I am not
sure I do understand, it seems you want to concatenate templates from
static and dynamic/runtime (provided by a service) fragments. Well,
that seems to be a challenging task, because templates are supposed to
be known during compile phase and waiting for $http to get
translations would require you to manually postpone compilation.
However: I am not sure if this is exactly what you were asking.
Can you provide an example?
By the way: generally I think it is not a good idea to implement
localization that way. If you could make all the messages not to leak
out of HTML templates, you could make your back-end to provide already
translated templates, so you would never have to deal with that in
your application. End to end testing should be easier as well...
Regards,
Witold Szczerba
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To post to this group, send email to
ang...@googlegroups.com.
> To unsubscribe from this group, send email to
>
angular+u...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/angular?hl=en.
>
>