Comments (2)
I'm not sure, but the issue may have been caused by moving handleAjaxUpdates from oncomplete to onsuccess (which in turn was necessary because the $injector tends to get lost or inaccessible after destroying scopes).
jsf.ajax.addOnEvent(function (data) {
if (data.status === 'begin') {
requestOngoing = true;
onCompleteCallbacks = [];
}
if (data.status === 'complete') {
}
if (data.status === 'success') {
// todo: handleAjaxUpdates() should be called in the 'complete' branch
// - find a way to pass the injector around
var theInjector=destroyScopes(data.responseXML);
handleAjaxUpdates(data.responseXML, theInjector);
requestOngoing = false;
}
});
from jsf-updates-angular.
Small typo: originally destroyScopes is done in complete phase and handleAjaxUpdates is done in succcess phase. In your code you moved destroyscopes and not handleAjaxUpdates from complete to success phase.
As described in #3 the order when to destroy old scopes and when to let angular know about new elements is very important!
destroyScopes needs to be done in complete phase as only in this phase, JSF hasn't touched the DOM and has NOT updated the nodes with new ones. You NEED to destroy scopes in this phase, as updated DOM nodes don't know anything about angular and vice versa. As angular wouldn't be able to destroy anything this would cause a memory leak.
In success phase the DOM is updated by JSF and angular can do its magic for them.
I assume that your fix to get the injector and this move of destroying scopes in later phase are connected and is causing your problems.
from jsf-updates-angular.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsf-updates-angular.