javascript - angularfire not working with me , I don't know why? -
the html code - call required libraries
<!doctype html> <html> <head> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> <script type="text/javascript" src="https://www.gstatic.com/firebasejs/3.0.0/firebase.js"></script> <script type="text/javascript" src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script> <script type="text/javascript" src="js/app.js"></script> </head> <body ng-app="seworko"> <div ng-controller="users"> {{ 4+4 }} </div> </body> </html>
the javascript code
var app = angular.module("seworko", ["firebase"]); var config = { apikey:"mykey", authdomain:"mydomain.firebaseio.com", databaseurl:"https://myurl.firebaseio.com", storagebucket:"mybucket.com"}; firebase.initializeapp(config); app.controller("users", function($scope, $firebaseobject) { try { const rootref = firebase.database().ref().child('system'); const ref = rootref.child('global'); this.global = $firebaseobject(ref); } catch(e) { alert(e);//type error a.ref not function } });
i getting error -> type error a.ref not function !!
i don't know reason error followed many tutorials , , can't connect firebase angularjs using angularfire
Comments
Post a Comment