├── .angular-cli.json ├── .editorconfig ├── .gitignore ├── README.md ├── dist-browser ├── 3rdpartylicenses.txt ├── assets │ └── angular-logo.png ├── favicon.ico ├── index.html ├── inline.318b50c57b4eba3d437b.bundle.js ├── main.c42e1064d120e00ec6be.bundle.js ├── polyfills.b6b2cd0d4c472ac3ac12.bundle.js └── styles.7d9457d710877291a1ca.bundle.css ├── e2e ├── app.e2e-spec.ts ├── app.po.ts └── tsconfig.e2e.json ├── karma.conf.js ├── package-lock.json ├── package.json ├── protractor.conf.js ├── server.js ├── src ├── app │ ├── app-routing.module.ts │ ├── app.component.html │ ├── app.component.scss │ ├── app.component.spec.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── browser.app.module.ts │ ├── components │ │ ├── about │ │ │ ├── about.component.html │ │ │ ├── about.component.scss │ │ │ ├── about.component.spec.ts │ │ │ └── about.component.ts │ │ └── home │ │ │ ├── home.component.html │ │ │ ├── home.component.scss │ │ │ ├── home.component.spec.ts │ │ │ └── home.component.ts │ └── server.app.module.ts ├── assets │ ├── .gitkeep │ └── angular-logo.png ├── browser.main.ts ├── browser.tsconfig.app.json ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── favicon.ico ├── index.html ├── polyfills.ts ├── server.main.ts ├── server.tsconfig.app.json ├── styles.scss ├── test.ts ├── tsconfig.spec.json └── typings.d.ts ├── tsconfig.json └── tslint.json /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "name": "angular-ssr-example" 5 | }, 6 | "apps": [ 7 | { 8 | "platform": "browser", 9 | "root": "src", 10 | "outDir": "dist-browser", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "browser.main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "browser.tsconfig.app.json", 20 | "testTsconfig": "tsconfig.spec.json", 21 | "prefix": "app", 22 | "styles": [ 23 | "styles.scss" 24 | ], 25 | "scripts": [], 26 | "environmentSource": "environments/environment.ts", 27 | "environments": { 28 | "dev": "environments/environment.ts", 29 | "prod": "environments/environment.prod.ts" 30 | } 31 | }, 32 | { 33 | "platform": "server", 34 | "root": "src", 35 | "outDir": "dist-server", 36 | "main": "server.main.ts", 37 | "tsconfig": "server.tsconfig.app.json", 38 | "testTsconfig": "tsconfig.spec.json", 39 | "environmentSource": "environments/environment.ts", 40 | "environments": { 41 | "dev": "environments/environment.ts", 42 | "prod": "environments/environment.prod.ts" 43 | } 44 | } 45 | ], 46 | "e2e": { 47 | "protractor": { 48 | "config": "./protractor.conf.js" 49 | } 50 | }, 51 | "lint": [ 52 | { 53 | "project": "src/tsconfig.app.json", 54 | "exclude": "**/node_modules/**" 55 | }, 56 | { 57 | "project": "src/tsconfig.spec.json", 58 | "exclude": "**/node_modules/**" 59 | }, 60 | { 61 | "project": "e2e/tsconfig.e2e.json", 62 | "exclude": "**/node_modules/**" 63 | } 64 | ], 65 | "test": { 66 | "karma": { 67 | "config": "./karma.conf.js" 68 | } 69 | }, 70 | "defaults": { 71 | "styleExt": "scss", 72 | "component": {} 73 | } 74 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /dist-server 6 | /tmp 7 | /out-tsc 8 | 9 | # dependencies 10 | /node_modules 11 | 12 | # IDEs and editors 13 | /.idea 14 | .project 15 | .classpath 16 | .c9/ 17 | *.launch 18 | .settings/ 19 | *.sublime-workspace 20 | 21 | # IDE - VSCode 22 | .vscode/* 23 | !.vscode/settings.json 24 | !.vscode/tasks.json 25 | !.vscode/launch.json 26 | !.vscode/extensions.json 27 | 28 | # misc 29 | /.sass-cache 30 | /connect.lock 31 | /coverage 32 | /libpeerconnection.log 33 | npm-debug.log 34 | yarn-error.log 35 | testem.log 36 | /typings 37 | 38 | # e2e 39 | /e2e/*.js 40 | /e2e/*.map 41 | 42 | # System Files 43 | .DS_Store 44 | Thumbs.db 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Angular Server Side Rendering Example 2 | Tutorial for creating angular server side rendering application is available on [medium](https://medium.com/@thatisuday/server-side-rendering-ssr-in-angular-5-the-simplest-and-quickest-ssr-approach-34cf53224f32) 3 | -------------------------------------------------------------------------------- /dist-browser/3rdpartylicenses.txt: -------------------------------------------------------------------------------- 1 | core-js@2.5.5 2 | MIT 3 | Copyright (c) 2014-2018 Denis Pushkarev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | zone.js@0.8.26 24 | MIT 25 | The MIT License 26 | 27 | Copyright (c) 2016-2018 Google, Inc. 28 | 29 | Permission is hereby granted, free of charge, to any person obtaining a copy 30 | of this software and associated documentation files (the "Software"), to deal 31 | in the Software without restriction, including without limitation the rights 32 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 33 | copies of the Software, and to permit persons to whom the Software is 34 | furnished to do so, subject to the following conditions: 35 | 36 | The above copyright notice and this permission notice shall be included in 37 | all copies or substantial portions of the Software. 38 | 39 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 40 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 41 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 42 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 43 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 44 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 45 | THE SOFTWARE. 46 | 47 | cache-loader@1.2.2 48 | MIT 49 | Copyright JS Foundation and other contributors 50 | 51 | Permission is hereby granted, free of charge, to any person obtaining 52 | a copy of this software and associated documentation files (the 53 | 'Software'), to deal in the Software without restriction, including 54 | without limitation the rights to use, copy, modify, merge, publish, 55 | distribute, sublicense, and/or sell copies of the Software, and to 56 | permit persons to whom the Software is furnished to do so, subject to 57 | the following conditions: 58 | 59 | The above copyright notice and this permission notice shall be 60 | included in all copies or substantial portions of the Software. 61 | 62 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 63 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 64 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 65 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 66 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 67 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 68 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 69 | 70 | @angular-devkit/build-optimizer@0.3.2 71 | MIT 72 | The MIT License 73 | 74 | Copyright (c) 2017 Google, Inc. 75 | 76 | Permission is hereby granted, free of charge, to any person obtaining a copy 77 | of this software and associated documentation files (the "Software"), to deal 78 | in the Software without restriction, including without limitation the rights 79 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 80 | copies of the Software, and to permit persons to whom the Software is 81 | furnished to do so, subject to the following conditions: 82 | 83 | The above copyright notice and this permission notice shall be included in all 84 | copies or substantial portions of the Software. 85 | 86 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 87 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 88 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 89 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 90 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 91 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 92 | SOFTWARE. 93 | 94 | webpack@3.11.0 95 | MIT 96 | Copyright JS Foundation and other contributors 97 | 98 | Permission is hereby granted, free of charge, to any person obtaining 99 | a copy of this software and associated documentation files (the 100 | 'Software'), to deal in the Software without restriction, including 101 | without limitation the rights to use, copy, modify, merge, publish, 102 | distribute, sublicense, and/or sell copies of the Software, and to 103 | permit persons to whom the Software is furnished to do so, subject to 104 | the following conditions: 105 | 106 | The above copyright notice and this permission notice shall be 107 | included in all copies or substantial portions of the Software. 108 | 109 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 110 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 111 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 112 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 113 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 114 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 115 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 116 | 117 | @angular/core@5.2.10 118 | MIT 119 | MIT 120 | 121 | @angular/platform-browser@5.2.10 122 | MIT 123 | MIT 124 | 125 | @angular/common@5.2.10 126 | MIT 127 | MIT 128 | 129 | @angular/router@5.2.10 130 | MIT 131 | MIT 132 | 133 | @angular/platform-browser-dynamic@5.2.10 134 | MIT 135 | MIT -------------------------------------------------------------------------------- /dist-browser/assets/angular-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/dist-browser/assets/angular-logo.png -------------------------------------------------------------------------------- /dist-browser/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/dist-browser/favicon.ico -------------------------------------------------------------------------------- /dist-browser/index.html: -------------------------------------------------------------------------------- 1 | Home / Angular SSR -------------------------------------------------------------------------------- /dist-browser/inline.318b50c57b4eba3d437b.bundle.js: -------------------------------------------------------------------------------- 1 | !function(r){var n=window.webpackJsonp;window.webpackJsonp=function(e,u,c){for(var f,i,p,a=0,l=[];adocument.F=Object<\/script>"),t.close(),c=t.F;r--;)delete c.prototype[i[r]];return c()};t.exports=Object.create||function(t,e){var n;return null!==t?(u.prototype=r(t),n=new u,u.prototype=null,n[a]=t):n=c(),void 0===e?n:o(n,e)}},"8WbS":function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=n("KOrd"),a=r.has,u=r.key,c=function(t,e,n){if(a(t,e,n))return!0;var r=i(e);return null!==r&&c(t,r,n)};r.exp({hasMetadata:function(t,e){return c(t,o(e),arguments.length<3?void 0:u(arguments[2]))}})},"9GpA":function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},"9vb1":function(t,e,n){var r=n("bN1p"),o=n("kkCw")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},A16L:function(t,e,n){var r=n("R3AP");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},BbyF:function(t,e,n){var r=n("oeih"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},CEne:function(t,e,n){"use strict";var r=n("OzIq"),o=n("lDLk"),i=n("bUqO"),a=n("kkCw")("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},ChGr:function(t,e,n){n("yJ2x"),n("3q4u"),n("NHaJ"),n("v3hU"),n("zZHq"),n("vsh6"),n("8WbS"),n("yOtE"),n("EZ+5"),t.exports=n("7gX0").Reflect},DIVP:function(t,e,n){var r=n("UKM+");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},Dgii:function(t,e,n){"use strict";var r=n("lDLk").f,o=n("7ylX"),i=n("A16L"),a=n("rFzY"),u=n("9GpA"),c=n("vmSO"),s=n("uc2A"),f=n("KB1o"),l=n("CEne"),p=n("bUqO"),h=n("1aA0").fastKey,v=n("zq/X"),d=p?"_s":"size",y=function(t,e){var n,r=h(e);if("F"!==r)return t._i[r];for(n=t._f;n;n=n.n)if(n.k==e)return n};t.exports={getConstructor:function(t,e,n,s){var f=t(function(t,r){u(t,f,e,"_i"),t._t=e,t._i=o(null),t._f=void 0,t._l=void 0,t[d]=0,void 0!=r&&c(r,n,t[s],t)});return i(f.prototype,{clear:function(){for(var t=v(this,e),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var n=v(this,e),r=y(n,t);if(r){var o=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=o),o&&(o.p=i),n._f==r&&(n._f=o),n._l==r&&(n._l=i),n[d]--}return!!r},forEach:function(t){v(this,e);for(var n,r=a(t,arguments.length>1?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!y(v(this,e),t)}}),p&&r(f.prototype,"size",{get:function(){return v(this,e)[d]}}),f},def:function(t,e,n){var r,o,i=y(t,e);return i?i.v=n:(t._l=i={i:o=h(e,!0),k:e,v:n,p:r=t._l,n:void 0,r:!1},t._f||(t._f=i),r&&(r.n=i),t[d]++,"F"!==o&&(t._i[o]=i)),t},getEntry:y,setStrong:function(t,e,n){s(t,e,function(t,n){this._t=v(t,e),this._k=n,this._l=void 0},function(){for(var t=this._k,e=this._l;e&&e.r;)e=e.p;return this._t&&(this._l=e=e?e.n:this._t._f)?f(0,"keys"==t?e.k:"values"==t?e.v:[e.k,e.v]):(this._t=void 0,f(1))},n?"entries":"values",!n,!0),l(e)}}},Ds5P:function(t,e,n){var r=n("OzIq"),o=n("7gX0"),i=n("2p1q"),a=n("R3AP"),u=n("rFzY"),c=function(t,e,n){var s,f,l,p,h=t&c.F,v=t&c.G,d=t&c.P,y=t&c.B,g=v?r:t&c.S?r[e]||(r[e]={}):(r[e]||{}).prototype,k=v?o:o[e]||(o[e]={}),_=k.prototype||(k.prototype={});for(s in v&&(n=e),n)l=((f=!h&&g&&void 0!==g[s])?g:n)[s],p=y&&f?u(l,r):d&&"function"==typeof l?u(Function.call,l):l,g&&a(g,s,l,t&c.U),k[s]!=l&&i(k,s,p),d&&_[s]!=l&&(_[s]=l)};r.core=o,c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},DuR2:function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},"EZ+5":function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=n("XSOZ"),a=r.key,u=r.set;r.exp({metadata:function(t,e){return function(n,r){u(t,e,(void 0!==r?o:i)(n),a(r))}}})},FryR:function(t,e,n){var r=n("/whu");t.exports=function(t){return Object(r(t))}},IRJ3:function(t,e,n){"use strict";var r=n("7ylX"),o=n("fU25"),i=n("yYvK"),a={};n("2p1q")(a,n("kkCw")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},KB1o:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},KOrd:function(t,e,n){var r=n("WBcL"),o=n("FryR"),i=n("mZON")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},LhTa:function(t,e,n){var r=n("rFzY"),o=n("Q6Nf"),i=n("FryR"),a=n("BbyF"),u=n("plSV");t.exports=function(t,e){var n=1==t,c=2==t,s=3==t,f=4==t,l=6==t,p=5==t||l,h=e||u;return function(e,u,v){for(var d,y,g=i(e),k=o(g),_=r(u,v,3),m=a(k.length),b=0,w=n?h(e,m):c?h(e,0):void 0;m>b;b++)if((p||b in k)&&(y=_(d=k[b],b,g),t))if(n)w[b]=y;else if(y)switch(t){case 3:return!0;case 5:return d;case 6:return b;case 2:w.push(d)}else if(f)return!1;return l?-1:s||f?f:w}}},MsuQ:function(t,e,n){"use strict";var r=n("Dgii"),o=n("zq/X");t.exports=n("0Rih")("Map",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{get:function(t){var e=r.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(o(this,"Map"),0===t?0:t,e)}},r,!0)},NHaJ:function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=n("KOrd"),a=r.has,u=r.get,c=r.key,s=function(t,e,n){if(a(t,e,n))return u(t,e,n);var r=i(e);return null!==r?s(t,r,n):void 0};r.exp({getMetadata:function(t,e){return s(t,o(e),arguments.length<3?void 0:c(arguments[2]))}})},OzIq:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},PHqh:function(t,e,n){var r=n("Q6Nf"),o=n("/whu");t.exports=function(t){return r(o(t))}},Q6Nf:function(t,e,n){var r=n("ydD5");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},QG7u:function(t,e,n){var r=n("vmSO");t.exports=function(t,e){var n=[];return r(t,!1,n.push,n,e),n}},QKXm:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},Qh14:function(t,e,n){var r=n("ReGu"),o=n("QKXm");t.exports=Object.keys||function(t){return r(t,o)}},R3AP:function(t,e,n){var r=n("OzIq"),o=n("2p1q"),i=n("WBcL"),a=n("ulTY")("src"),u=Function.toString,c=(""+u).split("toString");n("7gX0").inspectSource=function(t){return u.call(t)},(t.exports=function(t,e,n,u){var s="function"==typeof n;s&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(s&&(i(n,a)||o(n,a,t[e]?""+t[e]:c.join(String(e)))),t===r?t[e]=n:u?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||u.call(this)})},ReGu:function(t,e,n){var r=n("WBcL"),o=n("PHqh"),i=n("ot5s")(!1),a=n("mZON")("IE_PROTO");t.exports=function(t,e){var n,u=o(t),c=0,s=[];for(n in u)n!=a&&r(u,n)&&s.push(n);for(;e.length>c;)r(u,n=e[c++])&&(~i(s,n)||s.push(n));return s}},SHe9:function(t,e,n){var r=n("wC1N"),o=n("kkCw")("iterator"),i=n("bN1p");t.exports=n("7gX0").getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},"UKM+":function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},"V3l/":function(t,e){t.exports=!1},VWgF:function(t,e,n){var r=n("OzIq"),o=r["__core-js_shared__"]||(r["__core-js_shared__"]={});t.exports=function(t){return o[t]||(o[t]={})}},WBcL:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},XO1R:function(t,e,n){var r=n("ydD5");t.exports=Array.isArray||function(t){return"Array"==r(t)}},XS25:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("ChGr"),o=(n.n(r),n("ZSR1"));n.n(o)},XSOZ:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},XvUs:function(t,e,n){var r=n("DIVP");t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},Y1N3:function(t,e){e.f=Object.getOwnPropertySymbols},Y1aA:function(t,e){e.f={}.propertyIsEnumerable},ZDXm:function(t,e,n){"use strict";var r,o=n("LhTa")(0),i=n("R3AP"),a=n("1aA0"),u=n("oYd7"),c=n("fJSx"),s=n("UKM+"),f=n("zgIt"),l=n("zq/X"),p=a.getWeak,h=Object.isExtensible,v=c.ufstore,d={},y=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},g={get:function(t){if(s(t)){var e=p(t);return!0===e?v(l(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return c.def(l(this,"WeakMap"),t,e)}},k=t.exports=n("0Rih")("WeakMap",y,g,c,!0,!0);f(function(){return 7!=(new k).set((Object.freeze||Object)(d),7).get(d)})&&(u((r=c.getConstructor(y,"WeakMap")).prototype,g),a.NEED=!0,o(["delete","has","get","set"],function(t){var e=k.prototype,n=e[t];i(e,t,function(e,o){if(s(e)&&!h(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)})}))},ZSR1:function(t,e,n){(function(t){!function(){"use strict";!function(t){var e=t.performance;function n(t){e&&e.mark&&e.mark(t)}function r(t,n){e&&e.measure&&e.measure(t,n)}if(n("Zone"),t.Zone)throw new Error("Zone already loaded.");var o,i=function(){function e(t,e){this._properties=null,this._parent=t,this._name=e?e.name||"unnamed":"",this._properties=e&&e.properties||{},this._zoneDelegate=new u(this,this._parent&&this._parent._zoneDelegate,e)}return e.assertZonePatched=function(){if(t.Promise!==S.ZoneAwarePromise)throw new Error("Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)")},Object.defineProperty(e,"root",{get:function(){for(var t=e.current;t.parent;)t=t.parent;return t},enumerable:!0,configurable:!0}),Object.defineProperty(e,"current",{get:function(){return x.zone},enumerable:!0,configurable:!0}),Object.defineProperty(e,"currentTask",{get:function(){return P},enumerable:!0,configurable:!0}),e.__load_patch=function(o,i){if(S.hasOwnProperty(o))throw Error("Already loaded patch: "+o);if(!t["__Zone_disable_"+o]){var a="Zone:"+o;n(a),S[o]=i(t,e,D),r(a,a)}},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!0,configurable:!0}),e.prototype.get=function(t){var e=this.getZoneWith(t);if(e)return e._properties[t]},e.prototype.getZoneWith=function(t){for(var e=this;e;){if(e._properties.hasOwnProperty(t))return e;e=e._parent}return null},e.prototype.fork=function(t){if(!t)throw new Error("ZoneSpec required!");return this._zoneDelegate.fork(this,t)},e.prototype.wrap=function(t,e){if("function"!=typeof t)throw new Error("Expecting function got: "+t);var n=this._zoneDelegate.intercept(this,t,e),r=this;return function(){return r.runGuarded(n,this,arguments,e)}},e.prototype.run=function(t,e,n,r){void 0===e&&(e=void 0),void 0===n&&(n=null),void 0===r&&(r=null),x={parent:x,zone:this};try{return this._zoneDelegate.invoke(this,t,e,n,r)}finally{x=x.parent}},e.prototype.runGuarded=function(t,e,n,r){void 0===e&&(e=null),void 0===n&&(n=null),void 0===r&&(r=null),x={parent:x,zone:this};try{try{return this._zoneDelegate.invoke(this,t,e,n,r)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{x=x.parent}},e.prototype.runTask=function(t,e,n){if(t.zone!=this)throw new Error("A task can only be run in the zone of creation! (Creation: "+(t.zone||y).name+"; Execution: "+this.name+")");if(t.state!==g||t.type!==O){var r=t.state!=m;r&&t._transitionTo(m,_),t.runCount++;var o=P;P=t,x={parent:x,zone:this};try{t.type==E&&t.data&&!t.data.isPeriodic&&(t.cancelFn=null);try{return this._zoneDelegate.invokeTask(this,t,e,n)}catch(t){if(this._zoneDelegate.handleError(this,t))throw t}}finally{t.state!==g&&t.state!==w&&(t.type==O||t.data&&t.data.isPeriodic?r&&t._transitionTo(_,m):(t.runCount=0,this._updateTaskCount(t,-1),r&&t._transitionTo(g,m,g))),x=x.parent,P=o}}},e.prototype.scheduleTask=function(t){if(t.zone&&t.zone!==this)for(var e=this;e;){if(e===t.zone)throw Error("can not reschedule task to "+this.name+" which is descendants of the original zone "+t.zone.name);e=e.parent}t._transitionTo(k,g);var n=[];t._zoneDelegates=n,t._zone=this;try{t=this._zoneDelegate.scheduleTask(this,t)}catch(e){throw t._transitionTo(w,k,g),this._zoneDelegate.handleError(this,e),e}return t._zoneDelegates===n&&this._updateTaskCount(t,1),t.state==k&&t._transitionTo(_,k),t},e.prototype.scheduleMicroTask=function(t,e,n,r){return this.scheduleTask(new c(T,t,e,n,r,null))},e.prototype.scheduleMacroTask=function(t,e,n,r,o){return this.scheduleTask(new c(E,t,e,n,r,o))},e.prototype.scheduleEventTask=function(t,e,n,r,o){return this.scheduleTask(new c(O,t,e,n,r,o))},e.prototype.cancelTask=function(t){if(t.zone!=this)throw new Error("A task can only be cancelled in the zone of creation! (Creation: "+(t.zone||y).name+"; Execution: "+this.name+")");t._transitionTo(b,_,m);try{this._zoneDelegate.cancelTask(this,t)}catch(e){throw t._transitionTo(w,b),this._zoneDelegate.handleError(this,e),e}return this._updateTaskCount(t,-1),t._transitionTo(g,b),t.runCount=0,t},e.prototype._updateTaskCount=function(t,e){var n=t._zoneDelegates;-1==e&&(t._zoneDelegates=null);for(var r=0;r0,macroTask:n.macroTask>0,eventTask:n.eventTask>0,change:t})},t}(),c=function(){function e(n,r,o,i,a,u){this._zone=null,this.runCount=0,this._zoneDelegates=null,this._state="notScheduled",this.type=n,this.source=r,this.data=i,this.scheduleFn=a,this.cancelFn=u,this.callback=o;var c=this;this.invoke=n===O&&i&&i.useG?e.invokeTask:function(){return e.invokeTask.call(t,c,this,arguments)}}return e.invokeTask=function(t,e,n){t||(t=this),z++;try{return t.runCount++,t.zone.runTask(t,e,n)}finally{1==z&&d(),z--}},Object.defineProperty(e.prototype,"zone",{get:function(){return this._zone},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!0,configurable:!0}),e.prototype.cancelScheduleRequest=function(){this._transitionTo(g,k)},e.prototype._transitionTo=function(t,e,n){if(this._state!==e&&this._state!==n)throw new Error(this.type+" '"+this.source+"': can not transition to '"+t+"', expecting state '"+e+"'"+(n?" or '"+n+"'":"")+", was '"+this._state+"'.");this._state=t,t==g&&(this._zoneDelegates=null)},e.prototype.toString=function(){return this.data&&"undefined"!=typeof this.data.handleId?this.data.handleId:Object.prototype.toString.call(this)},e.prototype.toJSON=function(){return{type:this.type,state:this.state,source:this.source,zone:this.zone.name,runCount:this.runCount}},e}(),s=j("setTimeout"),f=j("Promise"),l=j("then"),p=[],h=!1;function v(e){0===z&&0===p.length&&(o||t[f]&&(o=t[f].resolve(0)),o?o[l](d):t[s](d,0)),e&&p.push(e)}function d(){if(!h){for(h=!0;p.length;){var t=p;p=[];for(var e=0;e=0;n--)"function"==typeof t[n]&&(t[n]=h(t[n],e+"_"+n));return t}function w(t){return!t||!1!==t.writable&&!("function"==typeof t.get&&"undefined"==typeof t.set)}var T="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,E=!("nw"in k)&&"undefined"!=typeof k.process&&"[object process]"==={}.toString.call(k.process),O=!E&&!T&&!(!y||!g.HTMLElement),S="undefined"!=typeof k.process&&"[object process]"==={}.toString.call(k.process)&&!T&&!(!y||!g.HTMLElement),D={},x=function(t){if(t=t||k.event){var e=D[t.type];e||(e=D[t.type]=d("ON_PROPERTY"+t.type));var n=(this||t.target||k)[e],r=n&&n.apply(this,arguments);return void 0==r||r||t.preventDefault(),r}};function P(t,r,o){var i=e(t,r);if(!i&&o&&e(o,r)&&(i={enumerable:!0,configurable:!0}),i&&i.configurable){delete i.writable,delete i.value;var a=i.get,u=i.set,c=r.substr(2),s=D[c];s||(s=D[c]=d("ON_PROPERTY"+c)),i.set=function(e){var n=this;n||t!==k||(n=k),n&&(n[s]&&n.removeEventListener(c,x),u&&u.apply(n,m),"function"==typeof e?(n[s]=e,n.addEventListener(c,x,!1)):n[s]=null)},i.get=function(){var e=this;if(e||t!==k||(e=k),!e)return null;var n=e[s];if(n)return n;if(a){var o=a&&a.call(this);if(o)return i.set.call(this,o),"function"==typeof e[_]&&e.removeAttribute(r),o}return null},n(t,r,i)}}function z(t,e,n){if(e)for(var r=0;r1?new r(t,n):new r(t),l=e(f,"onmessage");return l&&!1===l.configurable?(c=o(f),s=f,[a,u,"send","close"].forEach(function(t){c[t]=function(){var e=i.call(arguments);if(t===a||t===u){var n=e.length>0?e[0]:void 0;if(n){var r=Zone.__symbol__("ON_PROPERTY"+n);f[r]=c[r]}}return f[t].apply(f,e)}})):c=f,z(c,["close","error","message","open"],s),c};var c=n.WebSocket;for(var s in r)c[s]=r[s]}(0,c)}}var pt=d("unbound");Zone.__load_patch("util",function(t,e,n){n.patchOnProperties=z,n.patchMethod=I,n.bindArguments=b}),Zone.__load_patch("timers",function(t){W(t,"set","clear","Timeout"),W(t,"set","clear","Interval"),W(t,"set","clear","Immediate")}),Zone.__load_patch("requestAnimationFrame",function(t){W(t,"request","cancel","AnimationFrame"),W(t,"mozRequest","mozCancel","AnimationFrame"),W(t,"webkitRequest","webkitCancel","AnimationFrame")}),Zone.__load_patch("blocking",function(t,e){for(var n=["alert","prompt","confirm"],r=0;r=0&&"function"==typeof n[r.cbIdx]?v(r.name,n[r.cbIdx],r,i,null):t.apply(e,n)}})}()}),Zone.__load_patch("XHR",function(t,e){!function(e){var u=XMLHttpRequest.prototype,f=u[c],l=u[s];if(!f){var p=t.XMLHttpRequestEventTarget;if(p){var h=p.prototype;f=h[c],l=h[s]}}var d="readystatechange",y="scheduled";function g(t){XMLHttpRequest[i]=!1;var e=t.data,r=e.target,a=r[o];f||(f=r[c],l=r[s]),a&&l.call(r,d,a);var u=r[o]=function(){r.readyState===r.DONE&&!e.aborted&&XMLHttpRequest[i]&&t.state===y&&t.invoke()};return f.call(r,d,u),r[n]||(r[n]=t),b.apply(r,e.args),XMLHttpRequest[i]=!0,t}function k(){}function _(t){var e=t.data;return e.aborted=!0,w.apply(e.target,e.args)}var m=I(u,"open",function(){return function(t,e){return t[r]=0==e[2],t[a]=e[1],m.apply(t,e)}}),b=I(u,"send",function(){return function(t,e){return t[r]?b.apply(t,e):v("XMLHttpRequest.send",k,{target:t,url:t[a],isPeriodic:!1,delay:null,args:e,aborted:!1},g,_)}}),w=I(u,"abort",function(){return function(t){var e=t[n];if(e&&"string"==typeof e.type){if(null==e.cancelFn||e.data&&e.data.aborted)return;e.zone.cancelTask(e)}}})}();var n=d("xhrTask"),r=d("xhrSync"),o=d("xhrListener"),i=d("xhrScheduled"),a=d("xhrURL")}),Zone.__load_patch("geolocation",function(t){t.navigator&&t.navigator.geolocation&&function(t,n){for(var r=t.constructor.name,o=function(o){var i=n[o],a=t[i];if(a){if(!w(e(t,i)))return"continue";t[i]=function(t){var e=function(){return t.apply(this,b(arguments,r+"."+i))};return C(e,t),e}(a)}},i=0;i0?arguments[0]:void 0)}},{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},fJSx:function(t,e,n){"use strict";var r=n("A16L"),o=n("1aA0").getWeak,i=n("DIVP"),a=n("UKM+"),u=n("9GpA"),c=n("vmSO"),s=n("LhTa"),f=n("WBcL"),l=n("zq/X"),p=s(5),h=s(6),v=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,e){return p(t.a,function(t){return t[0]===e})};y.prototype={get:function(t){var e=g(this,t);if(e)return e[1]},has:function(t){return!!g(this,t)},set:function(t,e){var n=g(this,t);n?n[1]=e:this.a.push([t,e])},delete:function(t){var e=h(this.a,function(e){return e[0]===t});return~e&&this.a.splice(e,1),!!~e}},t.exports={getConstructor:function(t,e,n,i){var s=t(function(t,r){u(t,s,e,"_i"),t._t=e,t._i=v++,t._l=void 0,void 0!=r&&c(r,n,t[i],t)});return r(s.prototype,{delete:function(t){if(!a(t))return!1;var n=o(t);return!0===n?d(l(this,e)).delete(t):n&&f(n,this._i)&&delete n[this._i]},has:function(t){if(!a(t))return!1;var n=o(t);return!0===n?d(l(this,e)).has(t):n&&f(n,this._i)}}),s},def:function(t,e,n){var r=o(i(e),!0);return!0===r?d(t).set(e,n):r[t._i]=n,t},ufstore:d}},fU25:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},gvDt:function(t,e,n){var r=n("UKM+"),o=n("DIVP"),i=function(t,e){if(o(t),!r(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,r){try{(r=n("rFzY")(Function.call,n("x9zv").f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,n){return i(t,n),e?t.__proto__=n:r(t,n),t}}({},!1):void 0),check:i}},jhxf:function(t,e,n){var r=n("UKM+"),o=n("OzIq").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},kic5:function(t,e,n){var r=n("UKM+"),o=n("gvDt").set;t.exports=function(t,e,n){var i,a=e.constructor;return a!==n&&"function"==typeof a&&(i=a.prototype)!==n.prototype&&r(i)&&o&&o(t,i),t}},kkCw:function(t,e,n){var r=n("VWgF")("wks"),o=n("ulTY"),i=n("OzIq").Symbol,a="function"==typeof i;(t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))}).store=r},lDLk:function(t,e,n){var r=n("DIVP"),o=n("xZa+"),i=n("s4j0"),a=Object.defineProperty;e.f=n("bUqO")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},mZON:function(t,e,n){var r=n("VWgF")("keys"),o=n("ulTY");t.exports=function(t){return r[t]||(r[t]=o(t))}},oYd7:function(t,e,n){"use strict";var r=n("Qh14"),o=n("Y1N3"),i=n("Y1aA"),a=n("FryR"),u=n("Q6Nf"),c=Object.assign;t.exports=!c||n("zgIt")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=c({},t)[n]||Object.keys(c({},e)).join("")!=r})?function(t,e){for(var n=a(t),c=arguments.length,s=1,f=o.f,l=i.f;c>s;)for(var p,h=u(arguments[s++]),v=f?r(h).concat(f(h)):r(h),d=v.length,y=0;d>y;)l.call(h,p=v[y++])&&(n[p]=h[p]);return n}:c},oeih:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},ot5s:function(t,e,n){var r=n("PHqh"),o=n("BbyF"),i=n("zo/l");t.exports=function(t){return function(e,n,a){var u,c=r(e),s=o(c.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if((u=c[f++])!=u)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},plSV:function(t,e,n){var r=n("boo2");t.exports=function(t,e){return new(r(t))(e)}},qkyc:function(t,e,n){var r=n("kkCw")("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},t(i)}catch(t){}return n}},rFzY:function(t,e,n){var r=n("XSOZ");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},s4j0:function(t,e,n){var r=n("UKM+");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},twxM:function(t,e,n){var r=n("lDLk"),o=n("DIVP"),i=n("Qh14");t.exports=n("bUqO")?Object.defineProperties:function(t,e){o(t);for(var n,a=i(e),u=a.length,c=0;u>c;)r.f(t,n=a[c++],e[n]);return t}},uc2A:function(t,e,n){"use strict";var r=n("V3l/"),o=n("Ds5P"),i=n("R3AP"),a=n("2p1q"),u=n("bN1p"),c=n("IRJ3"),s=n("yYvK"),f=n("KOrd"),l=n("kkCw")("iterator"),p=!([].keys&&"next"in[].keys()),h=function(){return this};t.exports=function(t,e,n,v,d,y,g){c(n,e,v);var k,_,m,b=function(t){if(!p&&t in O)return O[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},w=e+" Iterator",T="values"==d,E=!1,O=t.prototype,S=O[l]||O["@@iterator"]||d&&O[d],D=S||b(d),x=d?T?b("entries"):D:void 0,P="Array"==e&&O.entries||S;if(P&&(m=f(P.call(new t)))!==Object.prototype&&m.next&&(s(m,w,!0),r||"function"==typeof m[l]||a(m,l,h)),T&&S&&"values"!==S.name&&(E=!0,D=function(){return S.call(this)}),r&&!g||!p&&!E&&O[l]||a(O,l,D),u[e]=D,u[w]=h,d)if(k={values:T?D:b("values"),keys:y?D:b("keys"),entries:x},g)for(_ in k)_ in O||i(O,_,k[_]);else o(o.P+o.F*(p||E),e,k);return k}},ulTY:function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},v3hU:function(t,e,n){var r=n("dSUw"),o=n("QG7u"),i=n("wCso"),a=n("DIVP"),u=n("KOrd"),c=i.keys,s=i.key,f=function(t,e){var n=c(t,e),i=u(t);if(null===i)return n;var a=f(i,e);return a.length?n.length?o(new r(n.concat(a))):a:n};i.exp({getMetadataKeys:function(t){return f(a(t),arguments.length<2?void 0:s(arguments[1]))}})},vmSO:function(t,e,n){var r=n("rFzY"),o=n("XvUs"),i=n("9vb1"),a=n("DIVP"),u=n("BbyF"),c=n("SHe9"),s={},f={};(e=t.exports=function(t,e,n,l,p){var h,v,d,y,g=p?function(){return t}:c(t),k=r(n,l,e?2:1),_=0;if("function"!=typeof g)throw TypeError(t+" is not iterable!");if(i(g)){for(h=u(t.length);h>_;_++)if((y=e?k(a(v=t[_])[0],v[1]):k(t[_]))===s||y===f)return y}else for(d=g.call(t);!(v=d.next()).done;)if((y=o(d,k,v.value,e))===s||y===f)return y}).BREAK=s,e.RETURN=f},vsh6:function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=r.keys,a=r.key;r.exp({getOwnMetadataKeys:function(t){return i(o(t),arguments.length<2?void 0:a(arguments[1]))}})},wC1N:function(t,e,n){var r=n("ydD5"),o=n("kkCw")("toStringTag"),i="Arguments"==r(function(){return arguments}());t.exports=function(t){var e,n,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),o))?n:i?r(e):"Object"==(a=r(e))&&"function"==typeof e.callee?"Arguments":a}},wCso:function(t,e,n){var r=n("MsuQ"),o=n("Ds5P"),i=n("VWgF")("metadata"),a=i.store||(i.store=new(n("ZDXm"))),u=function(t,e,n){var o=a.get(t);if(!o){if(!n)return;a.set(t,o=new r)}var i=o.get(e);if(!i){if(!n)return;o.set(e,i=new r)}return i};t.exports={store:a,map:u,has:function(t,e,n){var r=u(e,n,!1);return void 0!==r&&r.has(t)},get:function(t,e,n){var r=u(e,n,!1);return void 0===r?void 0:r.get(t)},set:function(t,e,n,r){u(n,r,!0).set(t,e)},keys:function(t,e){var n=u(t,e,!1),r=[];return n&&n.forEach(function(t,e){r.push(e)}),r},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){o(o.S,"Reflect",t)}}},x9zv:function(t,e,n){var r=n("Y1aA"),o=n("fU25"),i=n("PHqh"),a=n("s4j0"),u=n("WBcL"),c=n("xZa+"),s=Object.getOwnPropertyDescriptor;e.f=n("bUqO")?s:function(t,e){if(t=i(t),e=a(e,!0),c)try{return s(t,e)}catch(t){}if(u(t,e))return o(!r.f.call(t,e),t[e])}},"xZa+":function(t,e,n){t.exports=!n("bUqO")&&!n("zgIt")(function(){return 7!=Object.defineProperty(n("jhxf")("div"),"a",{get:function(){return 7}}).a})},yJ2x:function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=r.key,a=r.set;r.exp({defineMetadata:function(t,e,n,r){a(t,e,o(n),i(r))}})},yOtE:function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=r.has,a=r.key;r.exp({hasOwnMetadata:function(t,e){return i(t,o(e),arguments.length<3?void 0:a(arguments[2]))}})},yYvK:function(t,e,n){var r=n("lDLk").f,o=n("WBcL"),i=n("kkCw")("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},ydD5:function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},zZHq:function(t,e,n){var r=n("wCso"),o=n("DIVP"),i=r.get,a=r.key;r.exp({getOwnMetadata:function(t,e){return i(t,o(e),arguments.length<3?void 0:a(arguments[2]))}})},zgIt:function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},"zo/l":function(t,e,n){var r=n("oeih"),o=Math.max,i=Math.min;t.exports=function(t,e){return(t=r(t))<0?o(t+e,0):i(t,e)}},"zq/X":function(t,e,n){var r=n("UKM+");t.exports=function(t,e){if(!r(t)||t._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return t}}},[1]); -------------------------------------------------------------------------------- /dist-browser/styles.7d9457d710877291a1ca.bundle.css: -------------------------------------------------------------------------------- 1 | body,html{padding:0;margin:0;font-size:14px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif} -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { AppPage } from './app.po'; 2 | 3 | describe('angular-ssr-example App', () => { 4 | let page: AppPage; 5 | 6 | beforeEach(() => { 7 | page = new AppPage(); 8 | }); 9 | 10 | it('should display welcome message', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('Welcome to app!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/e2e", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "jasminewd2", 11 | "node" 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/1.0/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | coverageIstanbulReporter: { 19 | reports: [ 'html', 'lcovonly' ], 20 | fixWebpackSourcePaths: true 21 | }, 22 | angularCli: { 23 | environment: 'dev' 24 | }, 25 | reporters: ['progress', 'kjhtml'], 26 | port: 9876, 27 | colors: true, 28 | logLevel: config.LOG_INFO, 29 | autoWatch: true, 30 | browsers: ['Chrome'], 31 | singleRun: false 32 | }); 33 | }; 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular-ssr-example", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "ng": "ng", 7 | "start": "ng serve", 8 | "test": "ng test", 9 | "lint": "ng lint", 10 | "e2e": "ng e2e", 11 | "build:browser": "ng build --prod --app 0", 12 | "build:server": "ng build --prod --app 1 --output-hashing none", 13 | "build": "npm run build:browser && npm run build:server", 14 | "serve": "node server.js" 15 | }, 16 | "private": true, 17 | "dependencies": { 18 | "@angular/animations": "^5.2.0", 19 | "@angular/common": "^5.2.0", 20 | "@angular/compiler": "^5.2.0", 21 | "@angular/core": "^5.2.0", 22 | "@angular/forms": "^5.2.0", 23 | "@angular/http": "^5.2.0", 24 | "@angular/platform-browser": "^5.2.0", 25 | "@angular/platform-browser-dynamic": "^5.2.0", 26 | "@angular/platform-server": "^5.2.10", 27 | "@angular/router": "^5.2.0", 28 | "@nguniversal/express-engine": "^5.0.0", 29 | "core-js": "^2.4.1", 30 | "express": "^4.16.3", 31 | "rxjs": "^5.5.6", 32 | "zone.js": "^0.8.19" 33 | }, 34 | "devDependencies": { 35 | "@angular/cli": "~1.7.4", 36 | "@angular/compiler-cli": "^5.2.0", 37 | "@angular/language-service": "^5.2.0", 38 | "@types/jasmine": "~2.8.3", 39 | "@types/jasminewd2": "~2.0.2", 40 | "@types/node": "~6.0.60", 41 | "codelyzer": "^4.0.1", 42 | "jasmine-core": "~2.8.0", 43 | "jasmine-spec-reporter": "~4.2.1", 44 | "karma": "~2.0.0", 45 | "karma-chrome-launcher": "~2.2.0", 46 | "karma-coverage-istanbul-reporter": "^1.2.1", 47 | "karma-jasmine": "~1.1.0", 48 | "karma-jasmine-html-reporter": "^0.2.2", 49 | "protractor": "~5.1.2", 50 | "ts-node": "~4.1.0", 51 | "tslint": "~5.9.1", 52 | "typescript": "~2.5.3" 53 | } 54 | } -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | const { SpecReporter } = require('jasmine-spec-reporter'); 5 | 6 | exports.config = { 7 | allScriptsTimeout: 11000, 8 | specs: [ 9 | './e2e/**/*.e2e-spec.ts' 10 | ], 11 | capabilities: { 12 | 'browserName': 'chrome' 13 | }, 14 | directConnect: true, 15 | baseUrl: 'http://localhost:4200/', 16 | framework: 'jasmine', 17 | jasmineNodeOpts: { 18 | showColors: true, 19 | defaultTimeoutInterval: 30000, 20 | print: function() {} 21 | }, 22 | onPrepare() { 23 | require('ts-node').register({ 24 | project: 'e2e/tsconfig.e2e.json' 25 | }); 26 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 27 | } 28 | }; 29 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | // Angular requires Zone.js 2 | require('zone.js/dist/zone-node'); 3 | 4 | const express = require('express'); 5 | const { ngExpressEngine } = require('@nguniversal/express-engine'); 6 | 7 | // create express app 8 | const app = express(); 9 | 10 | // import server module bundle 11 | var { ServerAppModuleNgFactory } = require('./dist-server/main.bundle'); 12 | 13 | // set up engine for .html file 14 | app.engine('html', ngExpressEngine({ 15 | bootstrap: ServerAppModuleNgFactory 16 | })); 17 | 18 | app.set('view engine', 'html'); 19 | app.set('views', 'dist-browser'); 20 | 21 | // server static files 22 | app.use(express.static(__dirname + '/dist-browser', { index: false })); 23 | 24 | // return rendered index.html on every request 25 | app.get('*', (req, res) => { 26 | res.render('index', { req, res }); 27 | console.log(`new GET request at : ${req.originalUrl}`); 28 | }); 29 | 30 | // start server and listen 31 | app.listen(3000, () => { 32 | console.log('Angular server started on port 3000'); 33 | }); -------------------------------------------------------------------------------- /src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { Routes, RouterModule } from '@angular/router'; 3 | 4 | import { AboutComponent } from './components/about/about.component'; 5 | import { HomeComponent } from './components/home/home.component'; 6 | 7 | const routes: Routes = [ 8 | { path: '', component: HomeComponent }, 9 | { path: 'about', component: AboutComponent }, 10 | { path: '**', redirectTo: '/' }, 11 | ]; 12 | 13 | @NgModule({ 14 | imports: [RouterModule.forRoot(routes)], 15 | exports: [RouterModule] 16 | }) 17 | export class AppRoutingModule { } 18 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

Welcome to Angular SSR Example

2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /src/app/app.component.scss: -------------------------------------------------------------------------------- 1 | :host{ 2 | display: block; 3 | text-align: center; 4 | 5 | >.nav{ 6 | padding: 15px; 7 | 8 | >a{ 9 | display: inline-block; 10 | margin: 0 5px; 11 | padding: 5px 10px; 12 | text-decoration: none; 13 | color: #333; 14 | font-weight: 500; 15 | border: 2px solid grey; 16 | 17 | &:hover{ 18 | border-color: black; 19 | } 20 | 21 | &.active{ 22 | border-color: blue; 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { RouterTestingModule } from '@angular/router/testing'; 3 | import { AppComponent } from './app.component'; 4 | describe('AppComponent', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [ 8 | RouterTestingModule 9 | ], 10 | declarations: [ 11 | AppComponent 12 | ], 13 | }).compileComponents(); 14 | })); 15 | it('should create the app', async(() => { 16 | const fixture = TestBed.createComponent(AppComponent); 17 | const app = fixture.debugElement.componentInstance; 18 | expect(app).toBeTruthy(); 19 | })); 20 | it(`should have as title 'app'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app'); 24 | })); 25 | it('should render title in a h1 tag', async(() => { 26 | const fixture = TestBed.createComponent(AppComponent); 27 | fixture.detectChanges(); 28 | const compiled = fixture.debugElement.nativeElement; 29 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 30 | })); 31 | }); 32 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.scss'] 7 | }) 8 | export class AppComponent { 9 | title = 'app'; 10 | } 11 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { HttpClientModule } from '@angular/common/http'; 4 | import { CommonModule } from '@angular/common'; 5 | 6 | import { AppRoutingModule } from './app-routing.module'; 7 | 8 | import { AppComponent } from './app.component'; 9 | import { AboutComponent } from './components/about/about.component'; 10 | import { HomeComponent } from './components/home/home.component'; 11 | 12 | 13 | @NgModule({ 14 | declarations: [ 15 | AppComponent, 16 | AboutComponent, 17 | HomeComponent 18 | ], 19 | imports: [ 20 | CommonModule, 21 | AppRoutingModule, 22 | HttpClientModule 23 | ], 24 | providers: [] 25 | }) 26 | export class AppModule { } 27 | -------------------------------------------------------------------------------- /src/app/browser.app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | 4 | import { AppModule } from './app.module'; 5 | 6 | import { AppComponent } from './app.component'; 7 | 8 | 9 | @NgModule({ 10 | imports: [ 11 | AppModule, 12 | BrowserModule.withServerTransition({ appId: 'ssr-example' }), 13 | ], 14 | bootstrap: [AppComponent] 15 | }) 16 | export class BrowserAppModule { } 17 | -------------------------------------------------------------------------------- /src/app/components/about/about.component.html: -------------------------------------------------------------------------------- 1 |

Welcome to about section

2 | 3 |
    4 |
  • 5 | {{ user.name }} ({{ user.email }}) 6 |
  • 7 |
-------------------------------------------------------------------------------- /src/app/components/about/about.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/src/app/components/about/about.component.scss -------------------------------------------------------------------------------- /src/app/components/about/about.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { AboutComponent } from './about.component'; 4 | 5 | describe('AboutComponent', () => { 6 | let component: AboutComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ AboutComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(AboutComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Title, Meta } from '@angular/platform-browser'; 3 | import { HttpClient } from '@angular/common/http'; 4 | 5 | @Component({ 6 | selector: 'app-about', 7 | templateUrl: './about.component.html', 8 | styleUrls: ['./about.component.scss'] 9 | }) 10 | export class AboutComponent implements OnInit { 11 | public users: any = []; 12 | 13 | constructor( 14 | private title: Title, 15 | private meta: Meta, 16 | private http: HttpClient 17 | ) { } 18 | 19 | ngOnInit() { 20 | this.title.setTitle('About / Angular SSR'); 21 | this.meta.updateTag({ 22 | 'description': 'Welcome to about section' 23 | }); 24 | 25 | this.http.get('https://jsonplaceholder.typicode.com/users') 26 | .subscribe((users) => { 27 | this.users = users; 28 | }, (err) => { 29 | console.log(err); 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/app/components/home/home.component.html: -------------------------------------------------------------------------------- 1 |

Welcome to home section

2 | 3 | -------------------------------------------------------------------------------- /src/app/components/home/home.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/src/app/components/home/home.component.scss -------------------------------------------------------------------------------- /src/app/components/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/components/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { Title, Meta } from '@angular/platform-browser'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.scss'] 8 | }) 9 | export class HomeComponent implements OnInit { 10 | 11 | constructor( 12 | private title: Title, 13 | private meta: Meta 14 | ) { } 15 | 16 | ngOnInit() { 17 | this.title.setTitle('Home / Angular SSR'); 18 | this.meta.updateTag({ 19 | 'description': 'Welcome to home section' 20 | }); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/app/server.app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { ServerModule } from '@angular/platform-server'; 3 | import { NgModule } from '@angular/core'; 4 | 5 | import { AppModule } from './app.module'; 6 | import { AppRoutingModule } from './app-routing.module'; 7 | 8 | import { AppComponent } from './app.component'; 9 | 10 | 11 | @NgModule({ 12 | imports: [ 13 | AppModule, 14 | BrowserModule.withServerTransition({ appId: 'ssr-example' }), 15 | ServerModule, 16 | ], 17 | bootstrap: [AppComponent] 18 | }) 19 | export class ServerAppModule { } 20 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/assets/angular-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/src/assets/angular-logo.png -------------------------------------------------------------------------------- /src/browser.main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { environment } from './environments/environment'; 5 | import { BrowserAppModule } from './app/browser.app.module'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(BrowserAppModule) 12 | .catch(err => console.log(err)); 13 | -------------------------------------------------------------------------------- /src/browser.tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "angularCompilerOptions": { 4 | "entryModule": "./app/browser.app.module#BrowserAppModule" 5 | }, 6 | "compilerOptions": { 7 | "outDir": "../out-tsc/browser", 8 | "baseUrl": "./", 9 | "module": "es2015", 10 | "types": [] 11 | }, 12 | "exclude": [ 13 | "test.ts", 14 | "**/*.spec.ts" 15 | ] 16 | } -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/course-one/node-ng-ssr-example/bb96cac5440ab834502a4801f826c31edf325770/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home / Angular SSR 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | 17 | /*************************************************************************************************** 18 | * BROWSER POLYFILLS 19 | */ 20 | 21 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 22 | // import 'core-js/es6/symbol'; 23 | // import 'core-js/es6/object'; 24 | // import 'core-js/es6/function'; 25 | // import 'core-js/es6/parse-int'; 26 | // import 'core-js/es6/parse-float'; 27 | // import 'core-js/es6/number'; 28 | // import 'core-js/es6/math'; 29 | // import 'core-js/es6/string'; 30 | // import 'core-js/es6/date'; 31 | // import 'core-js/es6/array'; 32 | // import 'core-js/es6/regexp'; 33 | // import 'core-js/es6/map'; 34 | // import 'core-js/es6/weak-map'; 35 | // import 'core-js/es6/set'; 36 | 37 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 38 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 39 | 40 | /** IE10 and IE11 requires the following for the Reflect API. */ 41 | // import 'core-js/es6/reflect'; 42 | 43 | 44 | /** Evergreen browsers require these. **/ 45 | // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. 46 | import 'core-js/es7/reflect'; 47 | 48 | 49 | /** 50 | * Required to support Web Animations `@angular/platform-browser/animations`. 51 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 52 | **/ 53 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 54 | 55 | /** 56 | * By default, zone.js will patch all possible macroTask and DomEvents 57 | * user can disable parts of macroTask/DomEvents patch by setting following flags 58 | */ 59 | 60 | // (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame 61 | // (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick 62 | // (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames 63 | 64 | /* 65 | * in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js 66 | * with the following flag, it will bypass `zone.js` patch for IE/Edge 67 | */ 68 | // (window as any).__Zone_enable_cross_context_check = true; 69 | 70 | /*************************************************************************************************** 71 | * Zone JS is required by default for Angular itself. 72 | */ 73 | import 'zone.js/dist/zone'; // Included with Angular CLI. 74 | 75 | 76 | 77 | /*************************************************************************************************** 78 | * APPLICATION IMPORTS 79 | */ 80 | -------------------------------------------------------------------------------- /src/server.main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | export { ServerAppModule } from './app/server.app.module'; 3 | 4 | enableProdMode(); -------------------------------------------------------------------------------- /src/server.tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "angularCompilerOptions": { 4 | "entryModule": "./app/server.app.module#ServerAppModule" 5 | }, 6 | "compilerOptions": { 7 | "outDir": "../out-tsc/server", 8 | "baseUrl": "./", 9 | "module": "commonjs", 10 | "types": [] 11 | }, 12 | "exclude": [ 13 | "test.ts", 14 | "**/*.spec.ts" 15 | ] 16 | } -------------------------------------------------------------------------------- /src/styles.scss: -------------------------------------------------------------------------------- 1 | html, body{ 2 | padding: 0; 3 | margin: 0; 4 | font-size: 14px; 5 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; 6 | } -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/zone-testing'; 4 | import { getTestBed } from '@angular/core/testing'; 5 | import { 6 | BrowserDynamicTestingModule, 7 | platformBrowserDynamicTesting 8 | } from '@angular/platform-browser-dynamic/testing'; 9 | 10 | declare const require: any; 11 | 12 | // First, initialize the Angular testing environment. 13 | getTestBed().initTestEnvironment( 14 | BrowserDynamicTestingModule, 15 | platformBrowserDynamicTesting() 16 | ); 17 | // Then we find all the tests. 18 | const context = require.context('./', true, /\.spec\.ts$/); 19 | // And load the modules. 20 | context.keys().map(context); 21 | -------------------------------------------------------------------------------- /src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "types": [ 8 | "jasmine", 9 | "node" 10 | ] 11 | }, 12 | "files": [ 13 | "test.ts" 14 | ], 15 | "include": [ 16 | "**/*.spec.ts", 17 | "**/*.d.ts" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "arrow-return-shorthand": true, 7 | "callable-types": true, 8 | "class-name": true, 9 | "comment-format": [ 10 | true, 11 | "check-space" 12 | ], 13 | "curly": true, 14 | "deprecation": { 15 | "severity": "warn" 16 | }, 17 | "eofline": true, 18 | "forin": true, 19 | "import-blacklist": [ 20 | true, 21 | "rxjs", 22 | "rxjs/Rx" 23 | ], 24 | "import-spacing": true, 25 | "indent": [ 26 | true, 27 | "spaces" 28 | ], 29 | "interface-over-type-literal": true, 30 | "label-position": true, 31 | "max-line-length": [ 32 | true, 33 | 140 34 | ], 35 | "member-access": false, 36 | "member-ordering": [ 37 | true, 38 | { 39 | "order": [ 40 | "static-field", 41 | "instance-field", 42 | "static-method", 43 | "instance-method" 44 | ] 45 | } 46 | ], 47 | "no-arg": true, 48 | "no-bitwise": true, 49 | "no-console": [ 50 | true, 51 | "debug", 52 | "info", 53 | "time", 54 | "timeEnd", 55 | "trace" 56 | ], 57 | "no-construct": true, 58 | "no-debugger": true, 59 | "no-duplicate-super": true, 60 | "no-empty": false, 61 | "no-empty-interface": true, 62 | "no-eval": true, 63 | "no-inferrable-types": [ 64 | true, 65 | "ignore-params" 66 | ], 67 | "no-misused-new": true, 68 | "no-non-null-assertion": true, 69 | "no-shadowed-variable": true, 70 | "no-string-literal": false, 71 | "no-string-throw": true, 72 | "no-switch-case-fall-through": true, 73 | "no-trailing-whitespace": true, 74 | "no-unnecessary-initializer": true, 75 | "no-unused-expression": true, 76 | "no-use-before-declare": true, 77 | "no-var-keyword": true, 78 | "object-literal-sort-keys": false, 79 | "one-line": [ 80 | true, 81 | "check-open-brace", 82 | "check-catch", 83 | "check-else", 84 | "check-whitespace" 85 | ], 86 | "prefer-const": true, 87 | "quotemark": [ 88 | true, 89 | "single" 90 | ], 91 | "radix": true, 92 | "semicolon": [ 93 | true, 94 | "always" 95 | ], 96 | "triple-equals": [ 97 | true, 98 | "allow-null-check" 99 | ], 100 | "typedef-whitespace": [ 101 | true, 102 | { 103 | "call-signature": "nospace", 104 | "index-signature": "nospace", 105 | "parameter": "nospace", 106 | "property-declaration": "nospace", 107 | "variable-declaration": "nospace" 108 | } 109 | ], 110 | "unified-signatures": true, 111 | "variable-name": false, 112 | "whitespace": [ 113 | true, 114 | "check-branch", 115 | "check-decl", 116 | "check-operator", 117 | "check-separator", 118 | "check-type" 119 | ], 120 | "directive-selector": [ 121 | true, 122 | "attribute", 123 | "app", 124 | "camelCase" 125 | ], 126 | "component-selector": [ 127 | true, 128 | "element", 129 | "app", 130 | "kebab-case" 131 | ], 132 | "no-output-on-prefix": true, 133 | "use-input-property-decorator": true, 134 | "use-output-property-decorator": true, 135 | "use-host-property-decorator": true, 136 | "no-input-rename": true, 137 | "no-output-rename": true, 138 | "use-life-cycle-interface": true, 139 | "use-pipe-transform-interface": true, 140 | "component-class-suffix": true, 141 | "directive-class-suffix": true 142 | } 143 | } 144 | --------------------------------------------------------------------------------