Question: I'm in the process of writing an application which will allow the user to generate a variety of reports. There is a button which will bring up another window allowing the user to choose a specific date for the report. Now, my boss wants the head label to read what you're selected a date for, i.e. "Payroll Report Date Selection" or "Employee Report Date Selection". In my situation, this window looks exactly the same, aside from this label. My question is, is it feasible to reuse this window and just change the label based upon a passed parameter, or should I have a window for each? The code is going to work the same on all of them. Are there benefits to reusing the same window versus one window for each one?

Answer: 
set a flag just before the initial load, 

```
var initializing = true

```

and then when the first $watch fires, do 

```
$scope.$watch('fieldcontainer', function() {
  if (initializing) {
    $timeout(function() { initializing = false; });
  } else {
    // do whatever you were going to do
  }
});

```

The flag will be tear down just at the end of the current digest cycle, so next change won't be blocked.
During initial loading of current values old value field is undefined. So the example below helps you for excluding initial loadings.

```
$scope.$watch('fieldcontainer', 
  function(newValue, oldValue) {
    if (newValue && oldValue && newValue != oldValue) {
      // here what to do
    }
  }), true;

```