Skip to content

Commit 6ca45f0

Browse files
committedJul 6, 2017
Inverted logic
1 parent bba4568 commit 6ca45f0

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed
 

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-ssr",
3-
"version": "0.10.32",
3+
"version": "0.10.34",
44
"description": "Angular server-side rendering implementation",
55
"main": "build/index.js",
66
"typings": "build/index.d.ts",

‎source/application/builder/impl/application.ts

+7-12
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,19 @@ export class ApplicationImpl<V, M> implements Application<V> {
3030
this.render.pessimistic = (options && options.pessimistic) || false;
3131

3232
return Observable.create(async (observe) => {
33-
let routes = this.render.routes;
34-
if (routes == null || routes.length === 0) {
35-
routes = renderableRoutes(await this.discoverRoutes());
33+
if (this.render.routes == null || this.render.routes.length === 0) {
34+
this.render.routes = renderableRoutes(await this.discoverRoutes());
3635
}
3736

38-
routes = routes.filter((r: Route & {server?: boolean}) => {
39-
if (r.server == null) {
40-
return this.render.blacklist === true; // exclude all routes by default
41-
}
42-
return r.server; // explicit true or false will always be respected regardless of blacklisting
43-
});
37+
this.render.routes = (this.render.routes || []).filter((r: Route & {server?: boolean}) =>
38+
r.server == null
39+
? !this.render.blacklist
40+
: r.server);
4441

45-
if (routes.length === 0) {
42+
if (this.render.routes.length === 0) {
4643
observe.complete();
4744
}
4845
else {
49-
this.render.routes = routes;
50-
5146
this.renderToStream(this.render)
5247
.subscribe(
5348
observe.next.bind(observe),

0 commit comments

Comments
 (0)
Failed to load comments.