官术网_书友最值得收藏!

Creating an app using the CLI

Now, let's create the Angular application. We will create a new application for each example for the sake of clarity. You can club them into the same application if you feel comfortable. To create an Angular application using the CLI, run the following command in the Terminal:

ng new <project-name>

Replace project-name with the name of your project; if everything goes well, you should see something similar on your Terminal:

 installing ng
create .editorconfig
create README.md
create src/app/app.component.css
create src/app/app.component.html
create src/app/app.component.spec.ts
create src/app/app.component.ts
create src/app/app.module.ts
create src/assets/.gitkeep
create src/environments/environment.prod.ts
create src/environments/environment.ts
create src/favicon.ico
create src/index.html
create src/main.ts
create src/polyfills.ts
create src/styles.css
create src/test.ts
create src/tsconfig.app.json
create src/tsconfig.spec.json
create src/typings.d.ts
create .angular-cli.json
create e2e/app.e2e-spec.ts
create e2e/app.po.ts
create e2e/tsconfig.e2e.json
create .gitignore
create karma.conf.js
create package.json
create protractor.conf.js
create tsconfig.json
create tslint.json
Installing packages for tooling via npm.
Installed packages for tooling via npm.
Project 'project-name' successfully created.

If you run into any issues, ensure that you have angular-cli installed as described earlier. 

Before we write any code for this application, let's import the stack that we earlier created into the project. Since this is a helper component, I would like to group it along with other helper methods under the utils directory in the root of the application.

主站蜘蛛池模板: 抚松县| 固安县| 康乐县| 庄河市| 通城县| 叙永县| 黄山市| 台山市| 汕头市| 宾阳县| 义马市| 青阳县| 林芝县| 界首市| 江门市| 抚松县| 友谊县| 女性| 宁德市| 玉田县| 鄂尔多斯市| 容城县| 五河县| 阿拉善盟| 东乡| 剑川县| 融水| 汕尾市| 磐安县| 义乌市| 湘乡市| 宣武区| 随州市| 汽车| 池州市| 阳春市| 古蔺县| 盐山县| 襄汾县| 宁波市| 木兰县|