aeisenberg / angular-bind-notifier

On demand refreshing of AngularJS bindings. Vast performance improvements on complex apps.
http://aeisenberg.github.io/angular-bind-notifier/
MIT License
111 stars 13 forks source link

how to keep rebind notifier keys dynamically in the templates #40

Open jithureddy opened 7 years ago

jithureddy commented 7 years ago

Hello guys... I have different containers and each has it's own controller and template. So I have ng-repeat for some items in each container. Here I want to have bind notifier dynamically generated in the controller like below so that I can specifically update only single container ng-repeat.

Current Implementation

<div layout="column" ng-repeat="item in :refresh:$ctrl.iteration.work_items | limitTo : $ctrl.maxLimitOfItems" ng-repeat-end-custom="$ctrl.loadRemainingItems()" class="dragged-work-item-element work-item-space-top" id={{::item._id}}child data-item-type="parent" ng-show="item.isFilter" > </div>

Expected Implementation HTML <div layout="column" ng-repeat="item in :$ctrl.refreshKeyWord:$ctrl.folder.items | limitTo : $ctrl.maxLimitOfItems" ng-repeat-end-custom="$ctrl.loadRemainingItems()" class="dragged-work-item-element work-item-space-top" id={{::item._id}}child data-item-type="parent" ng-show="item.isFilter" > </div>

Controller logic:

during initialisation

self.refreshKeyWord = 'refreshItems'+self.folder._id;

After some event

$rootScope.$broadcast('$$rebind::refreshItems'+self.folder._id);

Currently I am using one notifier key to render all of items for all containers.

Please help me.