/
πŸ…°οΈ

Angular CLI

AngularCLI
Table of contents

ng CLI 정리 (a.k.a cheat sheet)

ng new (μƒˆλ‘œμš΄ μƒˆλ‘œμš΄ ν”„λ‘œμ νŠΈ 생성)

sh
$ ng new <name> [option]
sh
$ ng n <name> [options]

ng new의 μ˜΅μ…˜

-s ( --inlineStyle=true|false )

인라인 μŠ€νƒ€μΌλ‘œ 생성
(When true, includes styles inline in the component TS file.)

-t ( --inlineTemplate=true|false )

인라인 ν…œν”Œλ¦ΏμœΌλ‘œ 생성
(When true, includes template inline in the component TS file.)

-S ( --skipTests=true|false )

λŒ€λ¬Έμž S, ν…ŒμŠ€νŠΈ νŒŒμΌμ„ μƒμ„±ν•˜μ§€ μ•ŠλŠ”λ‹€.
(When true, does not generate "spec.ts" test files for the new project.)

-g ( --skipGit=true|false )

git μ΄λ‹ˆμ…œλΌμ΄μ§•μ„ ν•˜μ§€ μ•ŠμŒ
(When true, does not initialize a git repository.)

예)

sh
$ ng n new-project -s -t -S

new-projectλΌλŠ” 인라인 μŠ€νƒ€μΌ, 인라인 ν…œν”Œλ¦Ώ, ν…ŒμŠ€νŠΈ 파일 없이 μƒˆλ‘œμš΄ ν”„λ‘œμ νŠΈλ₯Ό μƒμ„±ν•œλ‹€.

ng generate

sh
$ ng generate <schematic> [options]
sh
$ ng g <schematic> [options]

곡톡 μ˜΅μ…˜

--flat 폴더 없이 생성

μ»΄ν¬λ„ŒνŠΈ 생성

sh
$ ng generate component <name> [otions]
sh
$ ng g c <name> [options]

λ””λ ‰ν‹°λΈŒ 생성

sh
$ ng generate directive <name> [options]
sh
$ ng g d <name> [optins]

μΈν„°νŽ˜μ΄μŠ€ 생성

sh
$ ng generate interface <name> <type> [options]
sh
$ ng g i <name> <type> [options]

νŒŒμ΄ν”„ 생성

sh
$ ng generate pipe <name> [options]
sh
$ ng g p <name> [options]

μ„œλΉ„μŠ€ 생성

sh
$ ng generate service <name> [options]
sh
$ ng g s <name> [options]

클래슀 생성

sh
$ ng generate class <name> [options]
sh
$ ng g cl <name> [options]

κ°€λ“œ 생성

sh
$ ng generate guard <name> [options]
sh
$ ng g g <name> [options]

reference

μžμ„Έν•œ μ„€λͺ…은 κ³΅μ‹λ¬Έμ„œ μ°Έκ³ ! https://angular.io/cli

logo
Things I've Learned