Angular has released its latest version, Angular 6.0. In this article, we will look at the new features of Angular 6.0 and also set up a new project with the help of Angular CLI 6.0 and Visual Studio Code.
What’s New in Angular 6.0?
- ng update: A new CLI command that will update your project dependencies to their latest versions.
- ng add: Another new CLI command that will make adding new capabilities to your project easier.
- Angular Elements: This is a new feature that allows us to compile Angular components to native web components which we can use in our Angular app.
- <template> element is deprecated: You can’t use <template> anymore inside of your component templates. You need to use <ng-template> instead.
- Angular CLI now has support for creating and building libraries. To create a library project within your CLI workspace, run the following command:
- ng generate library <name>
- For example:
ng generate library my-demo-lib
- Angular Material Starter Components: If you run
ng add @angular/materialto add material to an existing application, you will also be able to generate three new starter components.
- Material Sideman A starter component including a toolbar with the app name and the side navigation.
- Material Dashboard A starter dashboard component containing a dynamic grid list of cards.
- Material Data Table A starter data table component that is pre-configured with a datasource for sorting and pagination.
For example, in previous Angular versions, we used to reference our services as below: