今日から僕もフロントエンドエンジニアです。
angularのプロジェクト作成
$ git clone ほげほげ
$ cd ほげほげ/
または
$ mkdir angular-example
$ cd angular-example/
リモートから引っ張ってきたものであったり新規作成したディレクトリで、まっさらな状態を想定して書いてます。
https://angular.io/guide/setup-local
によるとnodeのバージョンは 10.9.0 or later
とのこと。(2019/10/18 現在)
$ node -v
v10.16.1
ヨシ!
$ npx @angular/cli new app --directory=. --style=styl --skipGit=true --routing=true --commit=false
https://angular.io/cli/new
newコマンドのオプション
styleはstylusにしたけど、ナウいっぽい以外の選定理由がない。
初期化時点で @angular/cli
もパッケージに含まれているため、以降でngコマンドを利用するときは npx ng ほげほげ
でローカルにインストールされたcliを使う。
ng-zorroの導入
$ npx ng add ng-zorro-antd
? Add icon assets [ Detail: https://ng.ant.design/components/icon/en ] No
? Set up custom theme file [ Detail: https://ng.ant.design/docs/customize-theme/en ] No
? Choose your locale code: ja_JP
? Choose template to create project: blank
動作確認
$ npx ng serve --open
今回はここまで!解散!