- Learning Ionic(Second Edition)
- Arvind Ravulavaru
- 326字
- 2021-07-02 23:24:26
Scaffolding an Angular 2 app
The first thing we are going to do is scaffold an Angular app using the Angular CLI. Create a new folder named chapter1 and open a command prompt/terminal in that folder and run the following:
ng new giphy-app
Now Angular CLI generator will go ahead and create all the files and folders necessary to work with our Angular app.
As mentioned earlier, you can check out Simple Angular 2 app with Angular CLI: https://www.youtube.com/watch?v=QMQbAoTLJX8, as well to go through Angular CLI docs: https://cli.angular.io/reference.pdf to know more about it.
The scaffolded project structure would look as follows:
.
├── .angular-cli.json
├── .editorconfig
├── README.md
├── e2e
│ ├── app.e2e-spec.ts
│ ├── app.po.ts
│ ├── tsconfig.e2e.json
├── karma.conf.js
├── node_modules
├── package.json
├── protractor.conf.js
├── src
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.ts
│ ├── assets
│ │ ├── .gitkeep
│ ├── environments
│ │ ├── environment.prod.ts
│ │ ├── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles.css
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ ├── typings.d.ts
├── tsconfig.json
├── tslint.json
We will be spending most of our time inside the src folder. Once the project is completely scaffolded, cd into the giphy-app folder and run the following:
ng serve
This will start the built-in server. Once the build is completed, we can navigate to http://localhost:4200 to view the page. The page should look something like this:

- DevOps with Kubernetes
- 前端跨界開發指南:JavaScript工具庫原理解析與實戰
- Arduino開發實戰指南:LabVIEW卷
- Vue.js快跑:構建觸手可及的高性能Web應用
- Java Web及其框架技術
- Android 7編程入門經典:使用Android Studio 2(第4版)
- STM32F0實戰:基于HAL庫開發
- Python完全自學教程
- C# and .NET Core Test Driven Development
- 響應式Web設計:HTML5和CSS3實戰(第2版)
- Elasticsearch Essentials
- 零代碼實戰:企業級應用搭建與案例詳解
- 從零開始學Python大數據與量化交易
- 計算機應用基礎案例教程(第二版)
- 零基礎學SQL(升級版)