Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic 2 twitter embedded timeline disappears

$
0
0

@Darkwolf097 wrote:

I have the code shown below, however after the user leaves the view the time line disappears?

The first time we go to the view the timeline is present but when we return the view disappears.

Here is my code

In Index.html

  <!-- Timeline Twitter -->
  <script src="http://platform.twitter.com/widgets.js"></script>

  <!-- cordova.js required for cordova apps -->
  <script src="cordova.js"></script>

In twitter.html

<ion-content>
    <ion-grid >
        <ion-row>
            <!--Timeline Twitter -->
            <a id="twitter" class="twitter-timeline"
               data-tweet-limit="10"
               data-chrome="noscrollbar nofooter"
               href="https://twitter.com/UnivLaRochelle">Tweet de L'université de la Rochelle</a>
        </ion-row>
    </ion-grid>
</ion-content>

In twitter.ts

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

@Component({
    selector: 'page-twitter',
    templateUrl: 'twitter.html',
})
export class twitterPage {

    constructor(public navCtrl: NavController) {

    }
    ngAfterViewInit() {
        !function(d,s,id){
            var js: any,
                fjs=d.getElementsByTagName(s)[0],
                p='https';
            if(!d.getElementById(id)){
                js=d.createElement(s);
                js.id=id;
                js.src=p+"://platform.twitter.com/widgets.js";
                fjs.parentNode.insertBefore(js,fjs);
            }
        }
        (document,"script","twitter-wjs");
    }
}

I tried several ways but I have not found any solution, can someone help me?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>