Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the ngc command do in an angular app?

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

like image 560
Craig Avatar asked Aug 17 '18 10:08

Craig


People also ask

Which command is used to serve the Angular app?

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.

What is TSC command in Angular?

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.

What is $compile in Angular?

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.

What is CLI Angular?

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.


1 Answers

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

like image 107
Anshuman Jaiswal Avatar answered Oct 08 '22 19:10

Anshuman Jaiswal