# Quickstart | AngularFire AngularFire is the officially supported AngularJS binding for Firebase. The combination of Angular and Firebase provides a three-way data binding between your HTML, your JavaScript, and the Firebase database. ## 1. Create an Account The first thing we need to do is [sign up for a free Firebase account](https://firebase.google.com/). A brand new Firebase project will automatically be created for you which you will use in conjunction with AngularFire to authenticate users and store and sync data. ## 2. Add Script Dependencies In order to use AngularFire in a project, include the following script tags: ```html ``` Firebase and AngularFire are also available via npm and Bower as `firebase` and `angularfire`, respectively. A [Yeoman generator](https://github.com/firebase/generator-angularfire) is also available. ## 3. Initialize the Firebase SDK We'll need to initialize the Firebase SDK before we can use it. You can find more details on the [web](https://firebase.google.com/docs/web/setup) or [Node](https://firebase.google.com/docs/server/setup) setup guides. ```js ``` ## 4. Inject the AngularFire Services Before we can use AngularFire with dependency injection, we need to register `firebase` as a module in our application. ```js var app = angular.module("sampleApp", ["firebase"]); ``` Now the `$firebaseObject`, `$firebaseArray`, and `$firebaseAuth` services are available to be injected into any controller, service, or factory. ```js app.controller("SampleCtrl", function($scope, $firebaseObject) { var ref = firebase.database().ref(); // download the data into a local object $scope.data = $firebaseObject(ref); // putting a console.log here won't work, see below }); ``` In the example above, `$scope.data` is going to be populated from the remote server. This is an asynchronous call, so it will take some time before the data becomes available in the controller. While it might be tempting to put a `console.log` on the next line to read the results, the data won't be downloaded yet, so the object will appear to be empty. Read the section on [Asynchronous Operations](guide/introduction-to-angularfire.md#handling-asynchronous-operations) for more details. ## 5. Add Three-Way, Object Bindings Angular is known for its two-way data binding between JavaScript models and the DOM, and Firebase has a lightning-fast, realtime database. For synchronizing simple key / value pairs, AngularFire can be used to *glue* the two together, creating a "three-way data binding" which automatically synchronizes any changes to your DOM, your JavaScript, and the Firebase database. To set up this three-way data binding, we use the `$firebaseObject` service introduced above to create a synchronized object, and then call `$bindTo()`, which binds it to a `$scope` variable. ```js var app = angular.module("sampleApp", ["firebase"]); app.controller("SampleCtrl", function($scope, $firebaseObject) { var ref = firebase.database().ref().child("data"); // download the data into a local object var syncObject = $firebaseObject(ref); // synchronize the object with a three-way data binding // click on `index.html` above to see it used in the DOM! syncObject.$bindTo($scope, "data"); }); ``` ```html