Getting Started with Angular 9

栏目: IT技术 · 发布时间: 5年前

内容简介:The Angular 9.0.0 version has been released now.This is a major release and have changes for entire platform, including the framework, Angular Material, and the CLI.The Ivy compiler is default runtime compiler, Earlier it was optional parameter to select c

The Angular 9.0.0 version has been released now.This is a major release and have changes for entire platform, including the framework, Angular Material, and the CLI.

The Ivy compiler is default runtime compiler, Earlier it was optional parameter to select compiler under angular 8.They can Improved build errors that will helpful to debug errors in the application.

The angular 9 introduced two new component YouTube and Google Maps.You can include into your application and take benefit of those component.

There are following breaking changes for angular 9 –

tslib

Table of Contents

Setting up Angular CLI v

You can install angular CLI by using following command, Open CMD in Administrator mode and run the following command.

// For Mac and Linux

sudo npm install -g @angular/cli

// For Windows

npm install -g @angular/cli

Now, run the following command to check the Angular CLI version.

ng version

How To Create a New Angular 9 Project

Let’s create a simple angular 9 application.Type the following command to create the new Angular 9 project –

ng new hello-angular9

The above CLI command will ask you two –

  • Would you like to add an Angular routing? Type y for Yes , n for NO
  • which stylesheet format would you like to use? Select CSS or other.

The above option use to add routing information into your application.You don’t need to add the routes for angular components to implement navigation in our application.You ll get app-routing.module.ts file inside the src >> app directory.

How To Run Angular 9 Application

I have created angular 9 application , Let’s run angular 9 application by running below command –

ng serve --open

The "–open" parameter will automatically open this Angular 9 app in the default browser.

The default URL is: http://localhost:4200

How To install Bootstrap 4

We will install bootstrap by using following command-

npm install bootstrap --save

Add the bootstrap css file inside an angular.json file.

"styles": [
   "src/styles.css",
   "./node_modules/bootstrap/dist/css/bootstrap.min.css"
 ],

How To Create Component

The Angular 9 CLI will use to create component. Type the following command to create the new component into the project –

ng g c employee-add --skipTests=true

The above command will create following files –

CREATE src/app/employee-add/employee-add.component.css (0 bytes)
CREATE src/app/employee-add/employee-add.component.html (25 bytes)
CREATE src/app/employee-add/employee-add.component.ts (290 bytes)

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

算法技术手册

算法技术手册

[美]海涅曼 (Heineman.G.T.)、[美]波利切 (Pollice.G.)、[美]塞克欧 (Selkow.S.) / 东南大学出版社 / 2009-4 / 58.00元

创造稳定的软件需要有效的算法,但是程序设计者们很少能在问题出现之前就想到。《算法技术手册(影印版)》描述了现有的可以解决多种问题的算法,并且能够帮助你根据需求选择并实现正确的算法——只需要一定的数学知识即可理解并分析算法执行。相对于理论来说,本书更注重实际运用,书中提供了多种程序语言中可用的有效代码解决方案,可轻而易举地适合一个特定的项目。有了这本书,你可以: 解决特定编码问题或改进现有解决......一起来看看 《算法技术手册》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具