https://github.com/nvm-sh/nvm
nvm install lts/dubnium
node --version
| server { | |
| listen 80; | |
| server_name mydomain.com; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name mydomain.com; |
| import { enableProdMode } from '@angular/core'; | |
| import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
| import { AppModule } from './app/app.module'; | |
| import { environment } from './environments/environment'; | |
| if (environment.production) { | |
| enableProdMode(); | |
| } |
| import { Component, OnInit } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| import { TransferState, makeStateKey } from '@angular/platform-browser'; | |
| const DOGS_KEY = makeStateKey('dogs'); | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] |
| import { BrowserModule, BrowserTransferStateModule } from '@angular/platform-browser'; | |
| import { HttpClientModule } from '@angular/common/http'; | |
| import { NgModule } from '@angular/core'; | |
| import { AppComponent } from './app.component'; | |
| @NgModule({ | |
| declarations: [ | |
| AppComponent | |
| ], |
| import { NgModule } from '@angular/core'; | |
| import { ServerModule, ServerTransferStateModule } from '@angular/platform-server'; | |
| import { AppModule } from './app.module'; | |
| import { AppComponent } from './app.component'; | |
| @NgModule({ | |
| imports: [ | |
| AppModule, | |
| ServerModule, |
| <div style="text-align:center"> | |
| <h1> | |
| Welcome to {{title}}! | |
| </h1> | |
| </div> | |
| <pre>{{ dogs | json}}</pre> | |
| import { Component, OnInit } from '@angular/core'; | |
| import { HttpClient } from '@angular/common/http'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'] | |
| }) | |
| export class AppComponent implements OnInit { |
| import { BrowserModule } from '@angular/platform-browser'; | |
| import { HttpClientModule } from '@angular/common/http'; | |
| import { NgModule } from '@angular/core'; | |
| import { AppComponent } from './app.component'; | |
| @NgModule({ | |
| declarations: [ | |
| AppComponent | |
| ], |
| { | |
| "name": "universal-demo-v5", | |
| "version": "0.0.0", | |
| "license": "MIT", | |
| "scripts": { | |
| "ng": "ng", | |
| "start": "ng serve", | |
| "build": "run-s build:client build:aot build:server", | |
| "build:client": "ng build -prod --build-optimizer --app 0", | |
| "build:aot": "ng build --aot --app 1", |