title: Thinkster.io Angularjs tutorial Chapter 3 - Problems connecting to Firebase
body: <p>I'm following <a href="http://www.thinkster.io/angularjs/S2MxGFCO0B/3-communicating-with-a-server-using-a-service-and-resource" rel="nofollow">this</a> tutorial, building an angularjs app with connection to the firebase database. I'm stuck at chapter 3 where my app is supposed to make it initial connection to the database. I kind of felt that problems were in front of me since my command prompt and jshint tells me:</p>
  
  <pre><code>Running "jshint:all" (jshint) task
  
  app\scripts\controllers\posts.js
    line 0   col 0  Bad option: 'app'.
    line 8   col 1  'app' is not defined.
  
  app\scripts\services\post.js
    line 0   col 0  Bad option: 'app'.
    line 2   col 1  'app' is not defined.
  
  6 problems
  
  Warning: Task "jshint:all" failed. Use --force to continue.
  
  Aborted due to warnings.
  </code></pre>
  
  <p>My console gives me:</p>
  
  <pre><code>&gt;Uncaught ReferenceError: app is not defined                      post.js
  &gt;Error: [$injector:unpr] Unknown provider: PostProvider &lt;- Post
  http://errors.angularjs.org/1.2.16/$injector/unpr?p0=PostProvider%20%3C-%20Post at http://localhost:9000/bower_components/angular/angular.js:78:12
  at http://localhost:9000/bower_components/angular/angular.js:3705:19
  at Object.getService [as get] (http://localhost:9000/bower_components/angular/angular.js:3832:39)
  at http://localhost:9000/bower_components/angular/angular.js:3710:45
  at getService (http://localhost:9000/bower_components/angular/angular.js:3832:39)
  at invoke (http://localhost:9000/bower_components/angular/angular.js:3859:13)
  at Object.instantiate (http://localhost:9000/bower_components/angular/angular.js:3880:23)
  at http://localhost:9000/bower_components/angular/angular.js:7134:28
  at link (http://localhost:9000/bower_components/angular-route/angular-route.js:913:26)
  at nodeLinkFn (http://localhost:9000/bower_components/angular/angular.js:6579:13) &lt;div ng-view="" class="ng-scope"&gt;
  </code></pre>
  
  <hr>
  
  <p>Why isn't my global declaration of 'app' seen by my other js-files?</p>
  
  <p>(apps.js)</p>
  
  <pre><code>var app = angular.module('angNewsApp', [
  'ngAnimate',
  'ngCookies',
  'ngResource',
  'ngRoute',
  'ngSanitize',
  'ngTouch'
  ])
  </code></pre>
  
  <p>(post.js)</p>
  
  <pre><code>'use strict';
  app.factory('Post', function ($resource){
  return $resource('https://sizzling-fire-1990.firebaseio.com/posts/:id.json');
  });
  </code></pre>
  
  <p>**All files content are copied from the tutorial</p>