0

My Question Title may not be optimal but I'm having difficulties finding a good one ...

Here is what I'm trying to achieve :

Using angularjs, I want to load google recpatcha (docs) with correct language.

Basic script loads perfectly :

<script src="http://www.google.com/recaptcha/api.js" async defer></script>

But as soon as I want to add my language parameter, its fails :

<script src="http://www.google.com/recaptcha/api.js&hl={{root.$stateParams.locale}}" async defer></script>

I can figure out at runtime root.$stateParams.locale is not yet defined so I imagine I will have to load this script outside HTML's header section but here is where I get lost !

How do I load this script the angular way ?

hugsbrugs
  • 3,501
  • 2
  • 29
  • 36
  • you can't do that on script and img tags. try like this for script injection - http://stackoverflow.com/q/8578617/ – YOU Apr 11 '15 at 15:32
  • Possible duplicate http://stackoverflow.com/questions/19028792/loading-an-external-script-using-script-src-in-angular – Dmitry Zaets Apr 11 '15 at 18:29

0 Answers0