1.

Angular CLI

Answer»

The Angular CLI or the command line interface is a very powerful and sophisticated tool that enables you to perform a lot of tasks in an Angular project by utilizing simple commands. Everything is handled by the CLI.     In order to scaffold a brand-new Angular project, for example, the CLI generates the application, compiles the application, and ships it to you for testing.   The development server monitors the source code files for changes and when you change any of them, it automatically compiles the source code files and refreshes the app in the browser.

CommandMeaning
npm install -g @angular/cliTo install the Angular CLI into our local machine using npm, run this command.
ng versionDisplays the information about the currently installed CLI.
ng new <application name>Using the ng new command, a new Angular application will be created.
ng new <application name> --prefix bestNew project is created, and the project prefix is set to new.
ng new --helpAll available Angular commands are returned by this command.
ng lint my-appLinting warnings are checked against this command in our entire application.
ng lint my-app --fixThis command will correct any form of linting errors.
ng lint my-app --format stylishOur entire codebase is formatted using this command.
ng lint my-app --helpThe list of linting commands is returned by this command.
ng add <package name>To use this command, you must first enable your package manager. Then, this command will use your package manager to download new dependencies and update your project with configuration changes.
ng generate component <name>A new component of our application will be created as a result of this command.
ng g s <service name>Creates a new class-based service based on Javascript classes.
ng g cl <destination>This command creates a new class in the specified directory.
ng buildAn application is created and stored in the dist directory using this command.
ng serveThe local development server is launched, and the app is served locally in the browser. Port and open are both specified. When you change any of the source files, the app is rebuilt and reloaded, and the page is changed automatically.
ng serve -oThis command opens up the application in a browser using any port 4200 or any available port
ng serve -sslThis command enables the application to be accessed using SSL.
ng generateTo produce elements, services, components, classes, providers, pipes, and other types of modules.
ng g c MyComponent -dThis dry runs the code and helps in cleaning the command line clean.
ng g c MyComponent --exportThis exports the component
ng g c MyComponent -fThis is used to overwrite the existing components. It forces rewriting.
ng g c --helpList of options for a given command is displayed using this.



Discussion

No Comment Found