marcorinck / jsf-updates-angular Goto Github PK
View Code? Open in Web Editor NEWUpdate angularJS after JSF Ajax requests are complete
Update angularJS after JSF Ajax requests are complete
current implementation only handles jsf UPDATES, not INSERTS.
(apparently inserts are seldom used, standard mojarra jsf doesn't seem to use them at all)
I observed an error message on this line:
var $compile = angular.element(document).injector().get('$compile')
Requesting the injector() specifically from the controller element does the trick for me:
var theInjector = angular.element(document.querySelector('[ng-controller]')).injector();
var $compile = theInjector.get('$compile');
Consider a JSF view containing an update="@Form". The form contains an input field that's incremented on the server side with each AJAX request. The input field also has an ng-model="myOldValue" directive.
The JSF response updates the value of the input field. Unfortunately, the old value is restored a short time later when the input field is compiled by AngularJS (because ng-model hasn't been updated).
Under certain circumstances the $injector object can't be accessed after destroying the child scopes. However, it can be accessed before. So far I didn't notice any disadvantage of retrieving and storing it before destroying the scopes.
This issue is addressed by my pull request.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.