0% found this document useful (0 votes)
6 views

Angular Questions

The document provides an overview of Angular CLI, a command line interface that simplifies web development by automating tasks such as project creation, component generation, and build optimization. It details various commands like 'ng new', 'ng generate', 'ng serve', and 'ng build', which facilitate project management and deployment. Additionally, it briefly explains arrow function expressions in JavaScript, highlighting their differences from traditional functions and their limitations.

Uploaded by

Stevany Corleone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Angular Questions

The document provides an overview of Angular CLI, a command line interface that simplifies web development by automating tasks such as project creation, component generation, and build optimization. It details various commands like 'ng new', 'ng generate', 'ng serve', and 'ng build', which facilitate project management and deployment. Additionally, it briefly explains arrow function expressions in JavaScript, highlighting their differences from traditional functions and their limitations.

Uploaded by

Stevany Corleone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Angular CLI

It’s a command line interface (CLI) built in Angular. It speeds up and simplifies the process of
web development. It provids a set of commands to automate creating, building, testing, and
deploying Angular projects. The CLI helps to:

– bootstrap a project (generates the initial project structure with a root NgModule, a root
component, webpack loader for bundling, module loading, jasmine test spec files)
– generate components, services, modules, and other Angular constructs
– manage project configurations
– optimize builds for production
– run development servers with live reloading
– integrate testing and linting tools

ng new <app-name>: A project with the specified project name will be bootstrapped with ng (ng
new my-app --routing --style=scss)

ng generate component <component-name>: This will generate a component with the specified
name

ng generate service <service-name>

ng generate module <module-name> (ng generate module auth --routing)

ng serve: This command will bundle all the code, build the application and will be available from
localhost:4200.

ng build: Compiles the application into a dist/ folder, ready for deployment

ng test: Runs the unit tests using Karma test runner


ng lint: Analyzes the code for potential errors or style issues based on the defined linting rules
(e.g., ESLint or TSLint)

ng analyze: (after ng build --prod --stats-json) Generates a stats.json file and provides tools to
analyze the size and performance of your build

ng update: Updates Angular CLI, Angular Core, and other dependencies to the latest
compatible versions

ng help: Displays a list of available Angular CLI commands with descriptions

JS

Arrow function expressions

Arrow function expressions is a compact alternative to a traditional function expression


(anonymous functions), with some semantic differences and deliberate limitations in usage:

– don't have their own bindings to this, arguments, or super, and should not be used as
methods
– cannot be used as constructors. Calling them with new throws a TypeError. They also
don't have access to the new.target keyword.
– cannot use yield within their body and cannot be created as generator functions.

let myFunction = (a, b) => a * b;

hello = (val) => "Hello " + val;

You might also like