title: $sce.trustAsResourceUrl Not Working With Twitter URL on Iframe
body: <p>I am trying to use $sce.trustAsResourceUrl to sanitize a Twitter URL that I am generating on the controller, however the button that is produced ignores the URL, and uses the current page URL instead.</p>
  
  <p>If I try printing what is in the controller to screen, that works fine.</p>
  
  <pre><code>&lt;iframe id="twitter-widget-0" scrolling="no" frameborder="0" allowtransparency="true" class="twitter-share-button twitter-share-button-rendered twitter-tweet-button" title="Twitter Tweet Button" ng-src="{{ctrl.twitterUniqueURL}}" style="position: static; visibility: visible; width: 60px; height: 20px;"&gt;&lt;/iframe&gt;
  
  .directive('referral', function ($rootScope, $sce, $interval, regex) {
      return {
          restrict: 'E',
          replace: true,
          templateUrl: $sce.trustAsResourceUrl($rootScope.environment.resources + 'website/html/manage/my-stuff/referral.html'),
          scope: true,
          link: function (scope) {
              scope.ctrl = {
                  init: function() {
                      scope.ctrl.getReferralCode();
                  },
                  form: {
                      email: ''
                  },
                  twitterUniqueURL: null,
                  getReferralCode: function() {
                      var check = $interval(function() {
                          if ($rootScope.ctrl &amp;&amp; $rootScope.ctrl.data &amp;&amp; 
                          $rootScope.ctrl.data.customer) {
                              scope.ctrl.referralCode = 
                        $rootScope.ctrl.data.customer.referralCodeForCustomer;
              scope.ctrl.twitterUniqueURL = $sce.trustAsResourceUrl("https://platform.twitter.com/widgets/tweet_button.b813cd3227574096a07e094b73331535.en.html#dnt=false&amp;amp;id=twitter-widget-0&amp;amp;lang=en&amp;amp;original_referer=https%3A%2F%2Fexample.co.uk%2Faccount%2F%3Freferral%26Code%3D" + scope.ctrl.referralCode + "&amp;amp;size=m&amp;amp;text=Receive%20%C2%A310%20when%20signing%20up%20for%20example.%20Live%20a%20Bigger%20Life%2C%20One%20Box%20at%20a%20Time.&amp;amp;time=1528123666174&amp;amp;type=share&amp;amp;url=https%3A%2F%2Fexample.co.uk%2F%3FReferral%3D" + scope.ctrl.referralCode + "&amp;amp;via=exampleUK");
                          }
                      }, 300)                         
                  },
              };
          scope.ctrl.init();
          }
      };
  })
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Apologies if I haven't explained this very well - only started using AngularJS two weeks ago.</p>
  
  <p>Thanks
  James</p>