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

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.

主站蜘蛛池模板: 个旧市| 连南| 友谊县| 金堂县| 太康县| 鄂伦春自治旗| 南宫市| 兴义市| 龙口市| 九台市| 三台县| 沽源县| 柳江县| 朝阳区| 丰城市| 班玛县| 甘南县| 阳西县| 广河县| 抚宁县| 新泰市| 长武县| 加查县| 黔西县| 九寨沟县| 集贤县| 青铜峡市| 金阳县| 牟定县| 灵武市| 姚安县| 江油市| 泰顺县| 长子县| 东乡族自治县| 陇川县| 水城县| 聊城市| 轮台县| 武隆县| 永安市|