Angular Questions
Angular Questions
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 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 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
JS
– 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.