I have created one of my first angular apps through the Thinkster IO tutorial and want to deploy the application to Firebase. I've run firebase init
and firebase deploy
, both of which run successfully.
When opening the application from firebase the page loads but shows nothing. On opening the JS console there are three errors
The errors are:
1) [blocked] The page at 'https://ngfantasyfootball.firebaseapp.com/' was loaded over HTTPS, but ran insecure content from 'http://static.firebase.com/v0/firebase.js': this content should also be loaded over HTTPS.
2) Uncaught ReferenceError: Firebase is not defined angularFire.js:17
3) Uncaught Error: [$injector:unpr] Unknown provider: angularFireAuthProvider <- angularFireAuth angular.js:60
Any ideas on how to solve the first error? The second, Firebase is not defined
says its from the angularFire script? The application runs locally without any errors so I am unsure as to why this comes up.
The 3rd error, angularFireAuthProvider. I've seen some questions that had answers about using simpleLogin instead of angularFireAut but am unsure if that is the source of the errors. Any help would would be great, I've been struggling with this for awhile now.
Config.JS
'use strict';
angular.module('fantasyApp.config', [])
app.config(['$routeProvider',
function($routeProvider) {
$routeProvider
.when('/', { templateUrl: 'views/default.html' })
.when('/signin', { templateUrl: 'views/users/signin.html' })
.when('/signup', { templateUrl: 'views/users/signup.html' })
.when('/nflteams', { templateUrl: 'views/nfl/list.html', authRequired: true })
.when('/nflteams/:nflTeamId', { templateUrl: 'views/nfl/view.html', authRequired: true })
.when('/leagues', { templateUrl: 'views/leagues/list.html', authRequired: true })
.when('/leagues/create', { templateUrl: 'views/leagues/edit.html', authRequired: true })
.when('/leagues/:leagueId', { templateUrl: 'views/leagues/view.html', authRequired: true })
.when('/leagues/:leagueId/edit', { templateUrl: 'views/leagues/edit.html', authRequired: true })
.when('/players', { templateUrl: 'views/players/list.html', authRequired: true })
.when('/players/:playerId', { templateUrl: 'views/players/view.html', authRequired: true })
.when('/fantasyteams', { templateUrl: 'views/fantasyteams/list.html', authRequired: true})
.when('/fantasyteams/create', { templateUrl: 'views/fantasyteams/edit.html', authRequired: true})
.when('/fantasyteams/:fantasyTeamId', { templateUrl: 'views/fantasyteams/view.html', authRequired: true})
.when('/fantasyteams/:fantasyTeamId/edit', { templateUrl: 'views/fantasyteams/edit.html', authRequired: true})
.otherwise( { redirectTo: '/' });
}])
// establish authentication
.run(['angularFireAuth', 'FBURL', '$rootScope',
function(angularFireAuth, FBURL, $rootScope) {
angularFireAuth.initialize(new Firebase(FBURL), {scope: $rootScope, name: 'auth', path: '/signin'});
$rootScope.FBURL = FBURL;
}])
.constant('FBURL', 'https://ngfantasyfootball.firebaseio.com/')
app.js
'use strict';
// Declare app level module which depends on filters, and services
var app = angular.module('fantasyApp',
[ 'fantasyApp.config'
, 'fantasyApp.controllers.header'
, 'fantasyApp.controllers.signin'
, 'fantasyApp.controllers.signup'
, 'fantasyApp.controllers.nfl'
, 'fantasyApp.controllers.leagues'
, 'fantasyApp.controllers.players'
, 'fantasyApp.controllers.fantasyTeams'
, 'firebase', 'ui.bootstrap', 'ngRoute']
)
'http://static.firebase.com/v0/firebase.js'
over HTTP. You probably have it somewhere in the HEAD of your HTML. Remove thehttp:
from the URL and will work fine both locally and from Firebase's hosting servers. So this is the include in one of my Firebase hosted apps<script src="//cdn.firebase.com/js/client/1.0.18/firebase.js"></script>
– Frank van Puffelennode scripts/web-server.js
– Nick Remlinger'http://static.firebase.com/v0/firebase.js'
to'https://static.firebase.com/v0/firebase.js'
got it to work. Thanks – Nick Remlinger