Thursday, December 6, 2018

What is new in Angular 6

1.

ng update

ng update  is a new CLI command that analyzes your package.json and uses its knowledge of Angular to recommend updates to your application. 
2.

ng add

Another new CLI command ng add  makes adding new capabilities to kiyour project easy. ng add will use your package manager to download new dependencies and invoke an installation script (implemented as a schematic) which can update your project with configuration changes, add additional dependencies (e.g. polyfills), or scaffold package-specific initialization code.
NoTry out some of the following on your fresh ng new application:
  • ng add @angular/pwa — Turn your application into a PWA by adding an app manifest and service worker
  • ng add @ng-bootstrap/schematics — Add ng-bootstrap to your application
  • 3. 
  • Angular Elements

    The first release of Angular Elements is focused on allowing you to bootstrap Angular components within an existing Angular application by registering them as Custom Elements. 
  • 4.

    CLI Workspaces

    CLI v6 now has support for workspaces containing multiple projects, such as multiple applications or libraries. CLI projects will now use angular.jsoninstead of .angular-cli.json for build and project configuration.
  • 5.
  • Library Support

    One of the most requested features for our CLI has been support for creating and building libraries, and we are proud to introduce:
    ng generate library
  • 6.
  • Tree Shakable Providers

    To make your applications smaller, we’ve moved from modules referencing services to services referencing modules. This allows us to only bundle services into your code base in modules where they are injected.

  • No references are needed in our NgModule.
  • import { Injectable } from '@angular/core';



    @Injectable({

      providedIn: 'root',

    })

    export class MyService {

      constructor() { }

    }

https://blog.angular.io/version-6-of-angular-now-available-cc56b0efa7a4

No comments:

Followers

Link