Why will my twitter widget not render if i change the view in angularjs?

前端 未结 6 1760
日久生厌
日久生厌 2021-01-01 22:46

Hi and thanks for reading.

I have a angular app im making and ive stumbled on a problem. set up as so

index.html-



        
6条回答
  •  [愿得一人]
    2021-01-01 23:17

    See this post: https://dev.twitter.com/discussions/890

    I think that you may be able to get the widget to re-render by calling twttr.widgets.load().

    If you find that this does not work, you will need to wrap this code into $timeout in your controller:

        controller('MyCtrl1', ['$scope', '$timeout', function ($scope, $timeout) {
                $timeout = twttr.widgets.load();
        }])
    

提交回复
热议问题