\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{theappchemist} \pdfinfo{ /Title (angular-cli.pdf) /Creator (Cheatography) /Author (theappchemist) /Subject (Angular CLI Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{333333} \definecolor{LightBackground}{HTML}{F8F8F8} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{Angular CLI Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{theappchemist} via \textcolor{DarkBackground}{\uline{cheatography.com/66963/cs/16742/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}theappchemist \\ \uline{cheatography.com/theappchemist} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 22nd August, 2018.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{3.36 cm} x{4.64 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng new \textless{}name\textgreater{} {[}options{]}}} \tn % Row 0 \SetRowColor{LightBackground} -{}-dry-run (alias: -d) & Run through without making any changes. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} -{}-force (alias: -f) & Forces overwriting files \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} -{}-verbose (alias: -v) & Adds more details to output logging. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} -{}-collection (alias: -c) & Schematics collection to use. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} -{}-inline-style (alias: -s) & Specifies if the style will be in the ts file. \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} -{}-inline-template (alias: -t) & Specifies if the template will be in the ts file. \tn % Row Count 13 (+ 3) % Row 6 \SetRowColor{LightBackground} -{}-view-encapsulation & Specifies the view encapsulation strategy. \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} -{}-inline-template (alias: -t) & Specifies if the template will be in the ts file. \tn % Row Count 18 (+ 3) % Row 8 \SetRowColor{LightBackground} -{}-view-encapsulation & Specifies the view encapsulation strategy. \tn % Row Count 20 (+ 2) % Row 9 \SetRowColor{white} -{}-routing & Generates a routing module. \tn % Row Count 22 (+ 2) % Row 10 \SetRowColor{LightBackground} -{}-prefix (alias: -p) & The prefix to apply to generated selectors. \tn % Row Count 24 (+ 2) % Row 11 \SetRowColor{white} -{}-style & The file extension to be used for style files. \tn % Row Count 26 (+ 2) % Row 12 \SetRowColor{LightBackground} -{}-skip-tests (alias: -S) & Skip creating spec files. \tn % Row Count 28 (+ 2) % Row 13 \SetRowColor{white} -{}-skip-package-json & Do not add dependencies to package.json. \tn % Row Count 30 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.24 cm} x{5.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng generate {[}type{]} {[}path/name{]}}} \tn % Row 0 \SetRowColor{LightBackground} class & Generates a class \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} component & Generates a component \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} directive & Generates a directive \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} enum & Generates a enumeration \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} guard & Generates a guard \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} interface & Generates an interface \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} module & Generates a module \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} pipe & Generates a pipe \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} service & Generates a service \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{You can also call it with ng g {[}type{]} {[}path/name{]}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng build {[}options{]}}} \tn % Row 0 \SetRowColor{LightBackground} -{}-prod & Flag to set configuration to "prod". \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} -{}-configuration (alias: -c) & Specify the configuration to use. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} -{}-main & The name of the main entry-point file. \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} -{}-polyfills & The name of the polyfills file. \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} -{}-ts-config & The name of the TypeScript configuration file. \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} -{}-optimization & Defines the optimization level of the build. \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} -{}-output-path & Path where output will be placed. \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} -{}-aot & Build using Ahead of Time compilation. \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} -{}-source-map & Output sourcemaps. \tn % Row Count 17 (+ 1) % Row 9 \SetRowColor{white} -{}-eval-source-map & Output in-file eval sourcemaps. \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} -{}-vendor-source-map & Resolve vendor packages sourcemaps. \tn % Row Count 21 (+ 2) % Row 11 \SetRowColor{white} -{}-vendor-chunk & Use a separate bundle containing only vendor libraries. \tn % Row Count 24 (+ 3) % Row 12 \SetRowColor{LightBackground} -{}-common-chunk & Use a separate bundle containing code used across multiple bundles. \tn % Row Count 27 (+ 3) % Row 13 \SetRowColor{white} -{}-base-href & Base url for the application being built. \tn % Row Count 29 (+ 2) % Row 14 \SetRowColor{LightBackground} -{}-deploy-url & URL where files will be deployed. \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng build {[}options{]} (cont)}} \tn % Row 15 \SetRowColor{LightBackground} -{}-verbose & Adds more details to output logging. \tn % Row Count 2 (+ 2) % Row 16 \SetRowColor{white} -{}-progress & Log progress to the console while building. \tn % Row Count 4 (+ 2) % Row 17 \SetRowColor{LightBackground} -{}-i18n-file & Localization file to use for i18n. \tn % Row Count 6 (+ 2) % Row 18 \SetRowColor{white} -{}-i18n-format & Format of the localization file specified with -{}-i18n-file. \tn % Row Count 9 (+ 3) % Row 19 \SetRowColor{LightBackground} -{}-i18n-locale & Locale to use for i18n. \tn % Row Count 10 (+ 1) % Row 20 \SetRowColor{white} -{}-i18n-missing-translation & How to handle missing translations for i18n. \tn % Row Count 12 (+ 2) % Row 21 \SetRowColor{LightBackground} -{}-extract-css & Extract css from global styles onto css files instead of js ones. \tn % Row Count 15 (+ 3) % Row 22 \SetRowColor{white} -{}-watch & Run build when files change. \tn % Row Count 17 (+ 2) % Row 23 \SetRowColor{LightBackground} -{}-output-hashing & Define the output filename cache-busting hashing mode. \tn % Row Count 20 (+ 3) % Row 24 \SetRowColor{white} -{}-poll & Enable and define the file watching poll time period in milliseconds. \tn % Row Count 23 (+ 3) % Row 25 \SetRowColor{LightBackground} -{}-delete-output-path & Delete the output path before building. \tn % Row Count 25 (+ 2) % Row 26 \SetRowColor{white} -{}-preserve-symlinks & Do not use the real path when resolving modules. \tn % Row Count 28 (+ 3) % Row 27 \SetRowColor{LightBackground} -{}-extract-licenses & Extract all licenses in a separate file, in the case of production builds only. \tn % Row Count 32 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng build {[}options{]} (cont)}} \tn % Row 28 \SetRowColor{LightBackground} -{}-show-circular-dependencies & Show circular dependency warnings on builds. \tn % Row Count 2 (+ 2) % Row 29 \SetRowColor{white} -{}-build-optimizer & Enables \seqsplit{@angular-devkit/build-optimizer} optimizations when using the 'aot' option. \tn % Row Count 6 (+ 4) % Row 30 \SetRowColor{LightBackground} -{}-named-chunks & Use file name for lazy loaded chunks. \tn % Row Count 8 (+ 2) % Row 31 \SetRowColor{white} -{}-subresource-integrity & Enables the use of subresource integrity validation. \tn % Row Count 11 (+ 3) % Row 32 \SetRowColor{LightBackground} -{}-service-worker & Generates a service worker config for production builds. \tn % Row Count 14 (+ 3) % Row 33 \SetRowColor{white} -{}-ngsw-config-path & Path to ngsw-config.json. \tn % Row Count 16 (+ 2) % Row 34 \SetRowColor{LightBackground} -{}-skip-app-shell & Flag to prevent building an app shell. \tn % Row Count 18 (+ 2) % Row 35 \SetRowColor{white} -{}-index & The name of the index HTML file. \tn % Row Count 20 (+ 2) % Row 36 \SetRowColor{LightBackground} -{}-stats-json & Generates a 'stats.json' file which can be analyzed using tools such as: \seqsplit{\#webpack-bundle-analyzer'} or https: \seqsplit{//webpack.github.io/analyse.} \tn % Row Count 26 (+ 6) % Row 37 \SetRowColor{white} -{}-fork-type-checker & Run the TypeScript type checker in a forked process. \tn % Row Count 29 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng serve {[}options{]}}} \tn % Row 0 \SetRowColor{LightBackground} -{}-prod & Flag to set configuration to "prod". \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} -{}-configuration (alias: -c) & Specify the configuration to use. \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} -{}-browser-target & Target to serve. \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} -{}-port & Port to listen on. \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} -{}-host & Host to listen on. \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} -{}-proxy-config & Proxy configuration file. \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} -{}-ssl & Serve using HTTPS. \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} -{}-ssl-key & SSL key to use for serving HTTPS. \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} -{}-ssl-cert & SSL certificate to use for serving HTTPS. \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} -{}-open (alias: -o) & Opens the url in default browser. \tn % Row Count 16 (+ 2) % Row 10 \SetRowColor{LightBackground} -{}-live-reload & Whether to reload the page on change, using live-reload. \tn % Row Count 19 (+ 3) % Row 11 \SetRowColor{white} -{}-public-host & Specify the URL that the browser client will use. \tn % Row Count 22 (+ 3) % Row 12 \SetRowColor{LightBackground} -{}-serve-path & The pathname where the app will be served. \tn % Row Count 24 (+ 2) % Row 13 \SetRowColor{white} -{}-disable-host-check & Don't verify connected clients are part of allowed hosts. \tn % Row Count 27 (+ 3) % Row 14 \SetRowColor{LightBackground} -{}-hmr & Enable hot module replacement. \tn % Row Count 29 (+ 2) % Row 15 \SetRowColor{white} -{}-watch & Rebuild on change. \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{x{3.28 cm} x{4.72 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng serve {[}options{]} (cont)}} \tn % Row 16 \SetRowColor{LightBackground} -{}-hmr-warning & Show a warning when the -{}-hmr option is enabled. \tn % Row Count 3 (+ 3) % Row 17 \SetRowColor{white} -{}-serve-path-default-warning & Show a warning when deploy-url/base-href use unsupported serve path values. \tn % Row Count 7 (+ 4) % Row 18 \SetRowColor{LightBackground} -{}-optimization & Defines the optimization level of the build. \tn % Row Count 9 (+ 2) % Row 19 \SetRowColor{white} -{}-aot & Build using Ahead of Time compilation. \tn % Row Count 11 (+ 2) % Row 20 \SetRowColor{LightBackground} -{}-source-map & Output sourcemaps. \tn % Row Count 12 (+ 1) % Row 21 \SetRowColor{white} -{}-eval-source-map & Output in-file eval sourcemaps. \tn % Row Count 14 (+ 2) % Row 22 \SetRowColor{LightBackground} -{}-vendor-source-map & Resolve vendor packages sourcemaps. \tn % Row Count 16 (+ 2) % Row 23 \SetRowColor{white} -{}-vendor-chunk & Use a separate bundle containing only vendor libraries. \tn % Row Count 19 (+ 3) % Row 24 \SetRowColor{LightBackground} -{}-common-chunk & Use a separate bundle containing code used across multiple bundles. \tn % Row Count 22 (+ 3) % Row 25 \SetRowColor{white} -{}-base-href & Base url for the application being built. \tn % Row Count 24 (+ 2) % Row 26 \SetRowColor{LightBackground} -{}-deploy-url & URL where files will be deployed. \tn % Row Count 26 (+ 2) % Row 27 \SetRowColor{white} -{}-verbose & Adds more details to output logging. \tn % Row Count 28 (+ 2) % Row 28 \SetRowColor{LightBackground} -{}-progress & Log progress to the console while building. \tn % Row Count 30 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.72 cm} x{5.28 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{ng update {[}package{]}}} \tn % Row 0 \SetRowColor{LightBackground} -{}-dry-run (alias: -d) & Run through without making any changes. \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} -{}-force & If false, will error out if installed packages are incompatible with the update. \tn % Row Count 6 (+ 4) % Row 2 \SetRowColor{LightBackground} -{}-all & Whether to update all packages in package.json. \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} -{}-next & Use the largest version, including beta and RCs. \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} -{}-migrate-only & Only perform a migration, does not update the installed version. \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} -{}-from & Version from which to migrate from. Only available with a single package being updated, and only on migration only. \tn % Row Count 18 (+ 5) % Row 6 \SetRowColor{LightBackground} -{}-to & Version up to which to apply migrations. Only available with a single package being updated, and only on migrations only. Requires from to be specified. Default to the installed version detected. \tn % Row Count 26 (+ 8) % Row 7 \SetRowColor{white} -{}-registry & The NPM registry to use. \tn % Row Count 27 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{Updates the current application to latest versions.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}