Question

I have a simple angularjs application with a pretty standard ng-view as follows:

    <div id="myContent">
        <div ng-view></div>
    </div>

My home page partial contains a twitter list:

<div class="container">
 <a class="twitter-timeline" width="1200" height='450' data-chrome="noheader nofooter noborders transparent"
data-tweet-limit="1" href="https://twitter.com/....."
data-widget-id="123.....">Tweets from
https://twitter.com/abc/def</a>
 <script> !function (d, s, id) {
 var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
 if (!d.getElementById(id)) {
                js = d.createElement(s);
                js.id = id;
                js.async=true;
                js.src = p + "://platform.twitter.com/widgets.js";
                fjs.parentNode.insertBefore(js, fjs);
            }
        }(document, "script", "twitter-wjs");</script>
    </div>

This works great on the first time the partial is accessed, the twitter list is rendered after a few seconds, but on subsequent returns to the partial the twitter list does not render unless I do a page refresh, and simply shows a link :Tweets from https://twitter.com/abc/def.

Is there a way that I could invoke a refresh of the twitter list in my controller? I could add it to a $timeout to invoke the widget once the page is rendered, but what function do I invoke to make the widget render?

Else do I need to query the twitter api directly (which I would like to avoid), and get the data directly ?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top