My code was as follows:
<paper-menu ng-model="mediaType" class="dropdown-content">
<paper-item>Video</paper-item>
<paper-item>Image</paper-item>
</paper-menu>
Using ng-polymer-elements.min.js, I would receive the following error:
Invalid mapping for "ngModel" - function name must be "property" or "event"
Using the ng-polymer-elements.js file (the full version), I do not see the error.
I dug into it and when Uglify passes over ng-polymer-elements.js, it converts this:
var multiSelectableMappings = {
ngModel: function property(element) {
return element.hasAttribute('multi') ? 'selectedValues' : 'selected';
}
};
into
multiSelectableMappings={ngModel:function(element){return element.hasAttribute("multi")?"selectedValues":"selected"}}
This unfortunately deletes the function name "property" which makes the following code throw the exception:
case 'function':
switch(mapped.name) {
case 'property':
mappingType = '=';
break;
case 'event':
mappingType = '&';
break;
default:
throw 'Invalid mapping for "' + attr
+ '" - function name must be "property" or "event"';
}
The mapped.name does not find the name 'property' in the function because Uglify removed it.
My code was as follows:
Using ng-polymer-elements.min.js, I would receive the following error:
Invalid mapping for "ngModel" - function name must be "property" or "event"Using the ng-polymer-elements.js file (the full version), I do not see the error.
I dug into it and when Uglify passes over ng-polymer-elements.js, it converts this:
into
This unfortunately deletes the function name "property" which makes the following code throw the exception:
The
mapped.namedoes not find the name 'property' in the function because Uglify removed it.