You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
I hesitated to submit this issue, since it may be not for many people.
(and because it will be done by angular.js itself in the future. cf. #2104)
connect-prerenderer is one of my projects, which allows to prerender html pages with angular.js on server side, and even bootstrap angular.js from the prerendered pages.
One of the biggest problems is how to keep interpolation in prerendered pages.
For example, <div>{{name}}</div> will be replaced with <div>John</div>,
but <div ng-bind-template="{{name}}"/> will be replaced with <div ng-bind-template="{{name}}">John</div>, at compilation.
The latter form allows to bootstrap from it, whereas the former does not.
My hack was to patch angular.js so that it keeps interpolation information in DOM and allows boostrap from a prerendered page.
The patch for angular-1.2.5 is here
However, I don't feel like I did it in a very nice way.
It would be really nice if angualr.js includes this functionality (not this patch) and
keep interpolation information in DOM (might be as comments?)
The text was updated successfully, but these errors were encountered:
This is one block to migrate to AngularJS, the pre-render step in the server is a big thing for us. The @dai-shi patch has it value but the framework should have a option to support such thing feature.
Could the AngularJS core team bring a good solution for this?
+1
This should be compatible with an bind-once functionality (#5408). (Bind-once would be prerendered without interpolation information and normal bindings would keep interpolation information.)
In that way one could use Angular as a complete solution for templating. You could re-use angular templates as you wish.
This is out of scope at this point of AngularJS development, as it would require considerable re-engineering. The new Angular supports server side rendering, and hydration of server side rendered templates.
I hesitated to submit this issue, since it may be not for many people.
(and because it will be done by angular.js itself in the future. cf. #2104)
connect-prerenderer is one of my projects, which allows to prerender html pages with angular.js on server side, and even bootstrap angular.js from the prerendered pages.
One of the biggest problems is how to keep interpolation in prerendered pages.
For example,
<div>{{name}}</div>
will be replaced with<div>John</div>
,but
<div ng-bind-template="{{name}}"/>
will be replaced with<div ng-bind-template="{{name}}">John</div>
, at compilation.The latter form allows to bootstrap from it, whereas the former does not.
My hack was to patch angular.js so that it keeps interpolation information in DOM and allows boostrap from a prerendered page.
The patch for angular-1.2.5 is here
However, I don't feel like I did it in a very nice way.
It would be really nice if angualr.js includes this functionality (not this patch) and
keep interpolation information in DOM (might be as comments?)
The text was updated successfully, but these errors were encountered: