ng-polymer-elements icon indicating copy to clipboard operation
ng-polymer-elements copied to clipboard

Added attributes angularEquals and onlyAngularToPolymer

Open martinsik opened this issue 9 years ago • 1 comments

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 uses angular.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 use angular.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's PathObserver. Using angular.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?

martinsik avatar Apr 27 '15 12:04 martinsik

@GabiAxel, @martinsik Any update on this? Looks like a healthy PR.

motin avatar Nov 15 '15 15:11 motin