I just came across this command in a tutorial and I am struggling to find any information on the ngc command. Can anyone shed some light please?
ng build --prod && ngc
ng serve command builds and serve the application. It rebuilds the application if changes occur. Here project is the name of the application as defined in angular. json.
TypeScript is a primary language for Angular application development. It is a superset of JavaScript with design-time support for type safety and tooling. Browsers can't execute TypeScript directly. Typescript must be "transpiled" into JavaScript using the tsc compiler, which requires some configuration.
Overview. Compiles an HTML string or DOM into a template and produces a template function, which can then be used to link scope and the template together. The compilation is a process of walking the DOM tree and matching DOM elements to directives. Note: This document is an in-depth reference of all directive options.
The Angular CLI is a command-line interface tool that you use to initialize, develop, scaffold, and maintain Angular applications directly from a command shell.
It's related to Angular Template Compiler.
ngc
is a drop-in replacement for tsc
.
As per repo doc:
First install angular, see https://github.com/angular/angular/blob/master/CHANGELOG.md#200-rc0-2016-05-02
$ npm install @angular/compiler-cli typescript@next @angular/platform-server @angular/compiler
Optional sanity check, make sure TypeScript can compile.
$ ./node_modules/.bin/tsc -p path/to/project
ngc is a drop-in replacement for tsc.
$ ./node_modules/.bin/ngc -p path/to/project
You can find complete description here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With