Added attributes angularEquals and onlyAngularToPolymer #42
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi! First of all you're mixng tab and space indentation which makes quite a mess in the code. Some lines have also spaces at the end. I think you should refactor it and use only spaces.
I already used this extension in a real app. I'm using
<core-list>
to render very large 5000*20 table. Therefore I had to add two new attributes that controll Angular's$watch
call.angularEquals
tells ng-polymer-elements whether you really want to use$watch(attr, handler, true)
which usesangular.equal()
internaly for object equality instead of comparing object references (basically one-way data binding). That's all right untill you're using<core-list>
which is an absolute overkill and basicaly makes it useless.onlyAngularToPolymer
this specifies that you're not going to modify the watched variable inside the Polymer element so you don't need to useangular.copy()
when the value changes (I'm actually not even sure if you need to make the copy anyway) and also you don't need to watch for changes with Polymer'sPathObserver
. Usingangular.copy()
makes such overhead that makes<core-list>
almost useless.If the attribute names are weird just rename them. I think these are both useful features and the default functionality remains unchanged when not using them at all. Also, if you merge this commit maybe mention them in
README.md
?