Given this directive:

```
writing.directive('writingFocus', function($timeout){
  return {
    restrict: 'AC',
    scope: false,
    link: function(scope, element, attrs){
      scope.$watch(attrs.writingFocus, function(value){
        console.log('Value from directive', value);
        if(value === true){
          $timeout(function(){
            element[0].focus();
            scope[attrs.writingFocus] = false; // Not in controller's scope!!!
          });
        }
      });
    }
  }
});

```

used this way:

```
<input type="text" ng-model="selectedNote.title" writing-focus="justOpened">

```

the changes made to justOpened (attrs.writingFocus) in the directive are not applied in the controller's scope where I'm watching it:

```
$scope.$watch('justOpened', function(val, old){console.log('value from controller', val, old)})

```

Even using an isolated scope with a two way binding isn't working:

```
writing.directive('writingFocus', function($timeout){
  return {
    restrict: 'AC',
    scope: {
        writingFocus: '='
    },
    link: function(scope, element, attrs){
      scope.$watch('writingFocus', function(value){
        console.log('Value from directive', value);
        if(value === true){
          $timeout(function(){
            element[0].focus();
            scope.writingFocus = false; // Not in controller's scope!!!
          });
        }
      });
    }
  }
});

```

It works the first time, taking the value from the controller but then it looks like there's no binding.

Controller:

```
writing.controller('NotesCtrl', function($scope){
  $scope.notes = db.findAll();
  $scope.$watch('justOpened', function(val, old){console.log('value from controller', val, old)})

  $scope.add = function(){
    var note = {title: 'new note'};
    note.id = db.insert(note);
    $scope.notes.unshift(note);
    $scope.open(note);
  }

  $scope.open = function(note){
    $scope.selectedNote = note;
    $scope.justOpened = true;
  }    

  $scope.open($scope.notes[0]);
});

```

### Update

The problem is that the directive is applied under two ngIf that create new scopes...