FTLinuxCourse - Tin tổng hợp mới nhất không thể bỏ lỡ
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính
No Result
View All Result
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính
No Result
View All Result
FTLinuxCourse - Tin tổng hợp mới nhất không thể bỏ lỡ
No Result
View All Result

Angular CLI configuration file

admin by admin
April 17, 2020
in Công Nghệ
0
Angular CLI configuration file



In this video we will discuss the significance of the Angular CLI configuration file (.angular-cli.json). This is the configuration file that the Angular CLI uses.

The settings from this file are used when we
1. Generate angular features likes components, pipes, services etc
2. Run unit and end-to-end tests
3. Build the application etc.

We will be revisiting this file many times as we progress through this Angular CLI course.

The table below shows some of the settings and their purpose. We will discuss the other settings and their purpose as we progress through the course.

project : name Name of the project

apps: root – The root directory of the application. Default is src. We can change this using the “source-dir” option when generating a new angular project using the “ng new” command

apps: outDir – The output directory for build results. Default is dist

apps: assets – List of application assets that you want to copy when building your project. By default, the src/assets/ folder and src/favicon.ico are copied over

apps: index – The name of the start HTML file which is index.html by default

apps: main – The name of the main entry-point file. main.ts by default

apps: polyfills – The name of the polyfills file. Angular is built on the latest standards of the web platform. Targeting such a wide range of browsers is challenging because not all browsers support all features of modern browsers. This can be compensated by using polyfill scripts that implement missing features in JavaScript

apps: styles – Global styles to be included in the build. Default is styles.css. We can also use less or scss. To change to less or scss, use the “style” option when generating a new angular project using the “ng new” command

apps: prefix – The selector prefix to apply for the generated components. Default is “app”. This can be changed by using the “prefix” option when generating a new angular project using the “ng new” command

The important point to take away is that the values in the Angular CLI configuration file depends on the options that you have used with the “ng new” command when generating a new angular project. For example, if you do not use the –prefix option with the “ng new” command, then the default value “app” is stored in the configuration file for “prefix” setting. So the root component (AppComponent) that is created at the application generation time has “app” as the selector prefix.

Instead if you want “pragim” as the prefix, use –prefix flag along with “ng new” command. When you do this several things happen
1. “pragim” is stored as the “prefix” setting value in .angular-cli.json configuration file

2. “pragim” is used as the selector prefix for the root component that the “ng new” command generates

3. Any new component that you generate in the future using the following command will also have “pragim” as the selector prefix
ng generate component componentName

4. If you want to override the prefix setting in the angular cli configuration file, you can use –prefix option with the generate command as shown below. This will generate the component “xyz” with the prefix “tech” instead of “pragim”ng generate component xyz –prefix tech

5. Some of the options like –prefix can be used with several commands like ng new and ng generate

Please note : If you generate a project with –skip-install flag and when you try to generate a new component using “ng new” command before executing the “npm install” command you will get the following error
node_modules appears empty you may need to run npm install

To fix this, please first execute “npm install” to install the required npm packages and then generate the component.

Text version of the video

Slides

Angular CLI Text articles & Slides

Angular CLI Tutorial

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

Nguồn: https://ftlinuxcourse.com

Xem thêm bài viết khác: https://ftlinuxcourse.com/cong-nghe

Xem thêm Bài Viết:

  • Tổng hợp cách xóa dữ liệu trùng nhau trong excel
  • Bật mí top 3 cách fix lỗi iPhone thỉnh thoảng bị đơ cảm ứng
  • Top 2 phương pháp lọc email từ comment facebook hiệu quả hiện nay
  • Hướng dẫn cách xác định công suất lốc tủ lạnh, tủ đông…
  • Cách tạo thông báo khi nhập trùng dữ liệu trong excel
Tags: Youtube
Previous Post

#SGT2 : Các phần mềm chỉnh sửa ảnh đẹp nên có trên smartphone

Next Post

học thiết kế đồ họa với các hình cơ bản trong illustrator

Next Post
học thiết kế đồ họa với các hình cơ bản trong illustrator

học thiết kế đồ họa với các hình cơ bản trong illustrator

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Xem Thêm

Những điều bạn có thể chưa biết về Thánh sim Hi Vietnamobile

Những điều bạn có thể chưa biết về Thánh sim Hi Vietnamobile

January 17, 2021
Xiaomi Mi 10 Pro thiết kế thời thương, màn hình cong ấn tượng

Xiaomi Mi 10 Pro thiết kế thời thương, màn hình cong ấn tượng

June 1, 2021
Địa chỉ in bao bì nhựa tại Đà Nẵng chiết khấu cao

Địa chỉ in bao bì nhựa tại Đà Nẵng chiết khấu cao

January 26, 2021
Địa chỉ bán đèn tuýp LED Philips uy tín và chất lượng trên thị trường?

Bán đèn tuýp led Philips – Skyled

July 27, 2020
Lựa chọn chủ đề in áo thun phù hợp

Lựa chọn dịch vụ in áo thun cotton cần lưu ý gì?

August 2, 2020
Cần xác định được điểm đặt pallet cao nhất để mua xe

Bí quyết chọn mua xe nâng điện đẩy tay

August 3, 2020

Về Chúng Tôi

Báo ftlinuxcourse.com 24h – Đón xem những tin tức mới nhất về tình hình chính trị, xã hội, an ninh trật tự, văn hóa – giải trí, thể thao, thông tin trong ngày.

  • Liên Hệ
  • Chính Sách Bảo Mật

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Lập Trình Linux
  • Công Nghệ
  • Máy Tính

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.