code: function getIsRequired() {
              var info = this;
              if (info.isRequired !== undefined) { return info.isRequired; }
  
              // We don't know if it is required yet.
              // Once bound to the entity we can determine whether the data property is required
              // Note: Not bound until *second* call to the directive's link function
              //       which is why you MUST call 'getIsRequired'
              //       inside 'valErrsChanged' rather than in the link function
              var entityType = info.getType();
              if (entityType) { // the bound entity is known
                  var requiredProperties =
                      getRequiredPropertiesForEntityType(entityType);
  
                  return info.isRequired = !!requiredProperties[info.propertyPath];
              }
              return undefined; // don't know yet
          }
docs: determine if bound property is required.