@@ -75,21 +75,21 @@ replayer.replayAll();
75
75
#### PrebootOptions
76
76
77
77
* ` appRoot ` (** required** ) - One or more selectors for apps in the page (i.e. so one string or an array of strings).
78
- * ` buffer ` (default true) - If true, preboot will attempt to buffer client rendering to an extra hidden div. In most
78
+ * ` buffer ` (default ` true ` ) - If true, preboot will attempt to buffer client rendering to an extra hidden div. In most
79
79
cases you will want to leave the default (i.e. true) but may turn off if you are debugging an issue.
80
80
* ` minify ` (deprecated) - minification has been removed in v6. Minification should be handled by the end-user
81
81
* ` eventSelectors ` (defaults below) - This is an array of objects which specify what events preboot should be listening for
82
82
on the server view and how preboot should replay those events to the client view.
83
83
See Event Selector section below for more details but note that in most cases, you can just rely on the defaults
84
84
and you don't need to explicitly set anything here.
85
- * ` noReplay ` (default false ) - The only reason why you would want to set this to true is if you want to
86
- manually trigger the replay yourself. This contrasts with the event selector ` noReplay ` , because this option is global
85
+ * ` replay ` (default ` true ` ) - The only reason why you would want to set this to ` false ` is if you want to
86
+ manually trigger the replay yourself. This contrasts with the event selector ` replay ` , because this option is global
87
87
88
88
This comes in handy for situations where you want to hold off
89
89
on the replay and buffer switch until AFTER some async events occur (i.e. route loading, http calls, etc.). By
90
90
default, replay occurs right after bootstrap is complete. In some apps, there are more events after bootstrap
91
91
however where the page continues to change in significant ways. Basically if you are making major changes to
92
- the page after bootstrap then you will see some jank unless you set ` noReplay ` to ` true ` and then trigger replay
92
+ the page after bootstrap then you will see some jank unless you set ` replay ` to ` false ` and then trigger replay
93
93
yourself once you know that all async events are complete.
94
94
95
95
To manually trigger replay, simply inject the EventReplayer like this:
@@ -118,12 +118,12 @@ Each event selector has the following properties:
118
118
* ` events ` - An array of event names to listen for (ex. ` ['focusin', 'keyup', 'click'] ` )
119
119
* ` keyCodes ` - Only do something IF event includes a key pressed that matches the given key codes.
120
120
Useful for doing something when user hits return in a input box or something similar.
121
- * ` preventDefault ` - If true, ` event.preventDefault() ` will be called to prevent any further event propagation.
122
- * ` freeze ` - If true, the UI will freeze which means displaying a translucent overlay which prevents
121
+ * ` preventDefault ` - If ` true ` , ` event.preventDefault() ` will be called to prevent any further event propagation.
122
+ * ` freeze ` - If ` true ` , the UI will freeze which means displaying a translucent overlay which prevents
123
123
any further user action until preboot is complete.
124
124
* ` action ` - This is a function callback for any custom code you want to run when this event occurs
125
125
in the server view.
126
- * ` noReplay ` - If true , the event won't be recorded or replayed. Useful when you utilize one of the other options above.
126
+ * ` replay ` - If ` false ` , the event won't be recorded or replayed. Useful when you utilize one of the other options above.
127
127
128
128
Here are some examples of event selectors from the defaults:
129
129
@@ -141,7 +141,7 @@ var eventSelectors = [
141
141
{ selector: ' form' , events: [' submit' ], preventDefault: true , freeze: true },
142
142
143
143
// for tracking focus (no need to replay)
144
- { selector: ' input,textarea' , events: [' focusin' , ' focusout' , ' mousedown' , ' mouseup' ], noReplay : true },
144
+ { selector: ' input,textarea' , events: [' focusin' , ' focusout' , ' mousedown' , ' mouseup' ], replay : false },
145
145
146
146
// user clicks on a button
147
147
{ selector: ' button' , events: [' click' ], preventDefault: true , freeze: true }
@@ -152,12 +152,12 @@ var eventSelectors = [
152
152
153
153
Preboot registers its reply code at the ` APP_BOOTSTRAP_LISTENER ` token which is called by Angular for every component that is bootstrapped. If you don't have the ` bootstrap ` property defined in your ` AppModule ` 's ` NgModule ` but you instead use the ` ngDoBootrap ` method (which is done e.g. when using ngUpgrade) this code will not run at all.
154
154
155
- To make Preboot work correctly in such a case you need to specify ` noReplay: true ` in the Preboot options and replay the events yourself. That is, import ` PrebootModule ` like this:
155
+ To make Preboot work correctly in such a case you need to specify ` replay: false ` in the Preboot options and replay the events yourself. That is, import ` PrebootModule ` like this:
156
156
157
157
``` typescript
158
158
PrebootModule .withConfig ({
159
159
appRoot: ' app-root' ,
160
- noReplay: true ,
160
+ replay: false ,
161
161
})
162
162
```
163
163
0 commit comments