I have the following:

```
$scope.$watch('duration.dayPreference',function(value){
        console.log(value);
        if(value=='every')
        {
             that.duration.days = 1;
        }
        else if(value=='selected')
        {
            //alert('test');
            that.duration.days=[];
        }
        else if(value=='everyday')
        {
            that.duration.days='everyday';
        }

    });

    this.selectDay = function (day) {
        $scope.duration.dayPreference = 'selected';
        //$scope.$apply();
        /*if(typeof(this.duration.days)!='object')
        {
            this.duration.days=[];
        }*/

        var index = this.duration.days.indexOf(day);
        if (index == -1) {
            //alert('test2');
            this.duration.days.push(day);
        }
        else {
            this.duration.days.splice(index, 1);
        }
    }

```

In this, when I do `$scope.duration.dayPreference = 'selected';` I expect the line below it to have the this.duration.days set to a blank array. But it doesn't. Upon a closer inspection, I found that the callback in the $watch runs after the line below the assignment. 

It may be very probable that, $watch may be using some kinda timers internally. What should be the way to do it then.