Question: I am learning Rails following a udemy tutorial. Everything was good until this [error](http://i.stack.imgur.com/cbw1M.png), I keep rewinding the video and watched it over and over following the exact steps but somehow I always end up with this error. 

Please help me the udemy forum as that course is not active at all so I am frustrated.

[this my view page](http://i.stack.imgur.com/hnvZq.png), this page is really weird with all these rules

Answer: 
Change to this:

```
$rootScope.is_logged_in = IsLoggedInService.IsLoggedIn();

```
Another approach, yet using the $rootScope, is to use **$broadcast** to create an observer for that variable. 

In order to do this, you should broadcast an event when this variable is changed, like this:

```
$rootScope.$broadcast('user_logged_in');

```

And then, watch it using the $on method. Here:

```
$scope.$on('user_logged_in', function(event, args) {
    // here you do what you want, like:
    $scope.logged_in = true;
});

```

If you want to know more about it, angular also provides the $emmit method, that is used when you want that scopes above yours listen to that event. ( you can find more here : [$rootScope.$broadcast vs. $scope.$emit](https://stackoverflow.com/questions/26752030/rootscope-broadcast-vs-scope-emit)

Yet, you should read more about in the **docs**, [What are scopes?](https://docs.angularjs.org/guide/scope) and here: [$rootScope.Scope](https://docs.angularjs.org/api/ng/type/$rootScope.Scope)