I have a directive that reads sync data from <title>
tag. Then it trigger a service which $broadcast
the data to all controllers.
But the controllers under <body>
tag are not receiving this. However if I move ng-app
attr from html
to body
, and move the directive with the controller from head
to body
. Then all the controllers will work properly.
Here is my sample code: http://jsbin.com/oBAMOs/4/edit?html,js,console,output
From the code I believe you can pretty much guess what I am trying to do. So why is this happening and is there a better way to achieve this?