So I have a project that requires me to have a third party integration with 
a commenting service (Gigya). In the controller I am using a factory that 
gets the JSON feed for the articles. 

I have the 3rd party JavaScript code that is supposed to update every time 
a new article from the feed is being viewed. I am using Views and Routing 
in order to reuse the index.html and load a partial for article details. 
That partial should contain the following code that will show comments from 
our public web site:
<div id="commentsDiv"></div>
<script type="text/javascript">
    var params =
    {
        categoryID: 7623701,
        streamID: '',
        version: 2,
        containerID: 'commentsDiv',
        cid:'',
        enabledShareProviders: 'facebook,twitter,linkedin'
    }
    gigya.comments.showCommentsUI(params);
</script>


The controller associated with that partial for article details 
uses $routeParams.itemId; to determine what article is being used and 
create the data object to supply values for all properties being displayed. 
The 3rd party script above needs one of the properties in the data (PostID) 
as the streamID value in order for comments to be tracked and synchronized. 
So obviously I cannot do this:

<div id="commentsDiv"></div>
<script type="text/javascript">
    var params =
    {
        categoryID: 7623701,
        streamID: '{{stories[whichItem].PostID}}',
        version: 2,
        containerID: 'commentsDiv',
        cid:'',
        enabledShareProviders: 'facebook,twitter,linkedin'
    }
    gigya.comments.showCommentsUI(params);
</script>

As {{stories[whichItem].PostID}} cannot be compiled inside the script. How 
would I go about making that value for PostID in the current Article to 
become a value I can pass into this 3rd party script?

-- 
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.

Reply via email to