Hi! I’m trying to build an app for my high school. Site: www.appsinc.tk
Problem: The widget works, but I can’t find out how to initialize the twitter widget on the twitter page immediately!
The script part of the Twitter embed code is in index.html in the head tags while the embed part is in twitterpage.html
I was playing around with where to put twttr.widgets.load() and when I put it in controllers.js
.controller('ThreeController', function ($scope) {
$scope.navTitle = "Twitter"
$scope.leftButtons = [{
type: 'button-icon icon ion-navicon',
tap: function(e) {
$scope.sideMenuController.toggleLeft();
twttr.widgets.load()
}
}];
I got it to load, but only after you click the Twitter page, then click the menu. This obviously is not good enough. I’m a complete beginner to web development and I think this is a painfully simple question for most of you! Thanks in advance for all help!
This is the project I based it on. The file structure is the same:
Relevant files
index.html: http://codeshare.io/AFvJQ
controllers.js: http://codeshare.io/vvs0u
twitterpage.html: http://codeshare.io/guGvk
app.js: http://codeshare.io/TbV0o