_propertySetterFactory(protoElement, isNgComponent, property) {
     var setterFn;
     var tagName = DOM.tagName(protoElement);
     var possibleCustomElement = tagName.indexOf('-') !== -1;
     if (possibleCustomElement && !isNgComponent) {
         // need to use late check to be able to set properties on custom elements
         setterFn = StringMapWrapper.get(this._lazyPropertySettersCache, property);
         if (isBlank(setterFn)) {
             var propertySetterFn = reflector.setter(property);
             setterFn = (receiver, value) => {
                 if (DOM.hasProperty(receiver, property)) {
                     return propertySetterFn(receiver, value);
                 }
             };
             StringMapWrapper.set(this._lazyPropertySettersCache, property, setterFn);
         }
     }
     else {
         setterFn = StringMapWrapper.get(this._eagerPropertySettersCache, property);
         if (isBlank(setterFn)) {
             if (DOM.hasProperty(protoElement, property)) {
                 setterFn = reflector.setter(property);
             }
             else {
                 setterFn = PropertySetterFactory._noopSetter;
             }
             StringMapWrapper.set(this._eagerPropertySettersCache, property, setterFn);
         }
     }
     return setterFn;
 }
Example #2
0
function isValidElementPropertyBinding(protoElement, isNgComponent, binding) {
    if (binding.type === api.PropertyBindingType.PROPERTY) {
        var tagName = dom_adapter_1.DOM.tagName(protoElement);
        var possibleCustomElement = tagName.indexOf('-') !== -1;
        if (possibleCustomElement && !isNgComponent) {
            // can't tell now as we don't know which properties a custom element will get
            // once it is instantiated
            return true;
        }
        else {
            return dom_adapter_1.DOM.hasProperty(protoElement, binding.property);
        }
    }
    return true;
}
 setterFn = function(receiver, value) {
   if (DOM.hasProperty(receiver, property)) {
     return propertySetterFn(receiver, value);
   }
 }
 setterFn = function (receiver, value) {
     if (dom_adapter_1.DOM.hasProperty(receiver, property)) {
         return propertySetterFn(receiver, value);
     }
 };
 setterFn = (receiver, value) => {
     if (DOM.hasProperty(receiver, property)) {
         return propertySetterFn(receiver, value);
     }
 };