title: Unable to fetch value from angular app.factory
body: <p>I am trying to share variable among the controller so I am using angular's Factory. I have following code for the same:</p>
  
  <pre><code>var app = angular.module('chartApp', ['ngRoute']);
  
  app.factory('UserVerified', function() {
      return {bool: false}; 
  });
  
  app.config(function ($routeProvider) {
      $routeProvider
      .when('/',{
          templateUrl: 'pages/home.html',
          controller: 'PredictionController'
      })  
  });
  
  app.controller('PredictionController', ['$scope', '$http', '$interval', function($scope, $http, $interval){
  
      $scope.hasPermission = UserVerified;
  
  }]);
  </code></pre>
  
  <p>and on HTML i am just using <code>hasPermission.bool</code> to set visibility of a <code>&lt;div&gt;</code>.</p>
  
  <p>But the issue is angularjs is unable to identify UserVerified defined in "app.factory".</p>
  
  <p>I am getting following error:</p>
  
  <pre><code>ReferenceError: UserVerified is not defined
  </code></pre>
  
  <p>I referred following : <a href="https://stackoverflow.com/questions/21919962/angular-share-data-between-controllers">Share data between AngularJS controllers</a></p>
  
  <p>Only difference I can find is, I am using dependencies which is not used in the example in the above link. </p>