Why aren't these variables printing in html view?
<p>An AngularJS app has a variable called <code>authenticated2</code> that needs to be accessible in an html view.  But the value is not printing out in the screen.  </p>

<p>What specific changes can be made to the code below to make sure that the value of <code>authenticated2</code> is printed out on the screen?</p>

<p>Here is the relevant html:  </p>

<pre><code>auth.authenticated2 is: {{ auth.authenticated2 }} &lt;br&gt;
authenticated2 is {{ authenticated2 }} &lt;br&gt;
$scope.authenticated2 is {{ $scope.authenticated2 }} &lt;br&gt;
&lt;div ng-show="auth.authenticated2=='yes'"&gt;
    &lt;h1&gt;Show some stuff.&lt;/h1&gt;
&lt;/div&gt;
</code></pre>

<p>As it stands, nothing is printed out when the above html view is loaded.  But the controller is hooked up to the view because other objects in the view are loaded based on other variables in the controller.  </p>

<p>Here is the relevant stuff in the <code>security.js</code> controller:  </p>

<pre><code>angular.module('secure', ['auth']).controller('secure', function($scope, $http, $sce, auth) {

    $scope.authenticated1 = function() {
        if(auth.authenticated1=='yes'){return true;}
        else{return false;}
    }

    $scope.authenticated2 = function() {
        if(auth.authenticated2=='yes'){return true;}
        else{return false;}
    }

    //bunch of unrelated stuff

    $scope.$on('$viewContentLoaded', function() {
        //bunch of unrelated stuff
    }

});
</code></pre>

<p>And here is the relevant stuff from <code>auth.js</code>:  </p>

<pre><code>angular.module('auth', ['ngCookies']).factory('auth', ['$rootScope', '$http', '$location', '$cookies', function($rootScope, $http, $location, $cookies){
    var auth = {

        authenticated1 : $cookies['AUTH1'],
        authenticated2 : $cookies['AUTH2'],

        //bunch of unrelated stuff  

        init : function(homePath, loginPath, logoutPath) {
            //bunch of unrelated stuff
        }
    };
    return auth;
}]);
</code></pre>