title: ngPattern binding not working
body: <p>I want to validate an input using ngPattern based off of the selection of a select. It works after the first selection, but any subsequent selection does't bind correctly.</p>
  
  <p>Here's a jsFiddle for reference:
  <a href="http://jsfiddle.net/PLRf5/17/" rel="noreferrer">http://jsfiddle.net/PLRf5/17/</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.6/angular.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" /&gt;
      &lt;style&gt;
          .field-validation-error {
              color: red;
          }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div class="container form-group" ng-app="mod1" ng-controller="ctrl1"&gt;
          &lt;p&gt;
              ng-pattern binding is not updating:
              Enter in 'asdf' then click Cuba. ngPattern should update and you should not see "Bad Format".
          &lt;/p&gt;
  
          &lt;div ng-form="genericAddressEntry"&gt;
              &lt;div class="form-group" data-ng-class="{ 'has-error': genericAddressEntry.country.$invalid }"&gt;
                  &lt;label for="country"&gt;Country&lt;/label&gt;
                  &lt;select name="country" class="form-control"
                      data-ng-model="selectedCountry"
                      data-ng-options="country as country.name for country in countries"
                      data-ng-required="true"
                      &gt;
                  &lt;/select&gt;
              &lt;/div&gt;
  
              &lt;div class="clearFix" ng-bind="selectedCountry | countryToPostalCodeRegex"&gt;&lt;/div&gt;
  
              &lt;div class="form-group " data-ng-class="{ 'has-error': genericAddressEntry.postalCode.$invalid }"&gt;
                  &lt;label for="postalCode"&gt;Zip Code&lt;/label&gt;
  
                  &lt;input name="postalCode" type="text" class="form-control" data-ng-model="editAddress.postalCode" data-ng-required="selectedCountry.requiresPostal"
                      ng-pattern="selectedCountry | countryToPostalCodeRegex" maxlength="12" /&gt;
                  &lt;span class="field-validation-error" data-ng-show="genericAddressEntry.postalCode.$error.pattern"&gt;Bad Format&lt;/span&gt;
                  &lt;span class="field-validation-error" data-ng-show="genericAddressEntry.postalCode.$error.required"&gt;Required&lt;/span&gt;
              &lt;/div&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
  
  
          //module:
          angular.module('mod1', [])
            .controller('ctrl1', ['$scope', function ($scope) {
             //   $scope.editAddress = { postalCode: "12345" };
                $scope.countries = [
                { name: 'United States', requiresPostal: true, postalRegEx: '^[0-9]{5}([-]?[0-9]{4})?$' },
                //{ name: 'Canada', requiresPostal: true, postalRegEx: '^[a-yA-Y]\d[a-zA-Z]( )?\d[a-zA-Z]\d$' },
                { name: 'Cuba', requiresPostal: false, postalRegEx: undefined }];
                $scope.selectedCountry = $scope.countries[0];
            }])
            .filter('countryToPostalCodeRegex', [function () {
                var allowAllRegex = new RegExp("^.*");
                var escapeRegex = function (str) {
                    return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&amp;");
                }
  
                return function (country) {
  
                    if (!country) {
                        return allowAllRegex;
                    }
                    if (!country.requiresPostal) {
                        return allowAllRegex;
                    }
  
                    if (!country.postalRegExObj) {
                        country.postalRegExObj = new RegExp(escapeRegex(country.postalRegEx), "i");
                    }
                    return country.postalRegExObj;
                };
            }]);
      &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>