Angular: How to force redirect directive?
HTML:
<div ng-repeat="obj in arr"> <custom-directive status-stored-in="obj"></custom-directive> </div> Problem:
I have a built-in page rotation for a lot of obj s. This means that the arr value representing the current obj s page will change. However, the obj in the status-stored-in="obj" not updated with the change.
My current solution is to add ng-if to customDirective , flickering its value back and forth to make it recompile. Is there any other equivalent, more accurate way to handle this?
Edit:
The beginning of the user directive:
module.directive 'checkbox', (checkboxHooks) -> restrict: 'E' scope: hook: '=' hookedTo: '=' statusStoredIn: '=' templateUrl: 'templates/checkbox.html' link: (scope, element, attr) -> The bottom line is that to store the checked status, it needs to get an object. All of this can be found here: [ coffee / js ].