My code displays the timeline initially, but it disappears when I navigate away from the view. Can anyone help me troubleshoot this issue?
Upon first visit to the view, the timeline is visible, but upon returning, it disappears.
Below is the code snippet:
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 have attempted various troubleshooting methods without success. Your assistance would be greatly appreciated in resolving this issue.