0
0
Angularframework~5 mins

Running and serving an Angular app - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What command do you use to start a development server for an Angular app?
You use ng serve to start a development server that watches your files and reloads the app automatically when you make changes.
Click to reveal answer
beginner
What is the default port Angular uses when you run ng serve?
The default port is 4200. You can access your app in the browser at http://localhost:4200.
Click to reveal answer
intermediate
How can you change the port when running ng serve?
Add the --port option like this: ng serve --port 4300. This will start the server on port 4300 instead of 4200.
Click to reveal answer
intermediate
What does the ng serve command do behind the scenes?
It compiles your Angular app, starts a local web server, watches your files for changes, and reloads the app in the browser automatically.
Click to reveal answer
beginner
How do you stop the Angular development server once it is running?
Press Ctrl + C in the terminal where ng serve is running. This stops the server.
Click to reveal answer
Which command starts the Angular development server?
Ang start
Bng build
Cng run
Dng serve
What URL do you open in your browser to see the app after running ng serve with default settings?
Ahttp://localhost:4200
Bhttp://localhost:5000
Chttp://localhost:8080
Dhttp://localhost:3000
How do you change the port when running the Angular server?
Ang serve --port 4300
Bng serve -p 4300
Cng serve --port=4300
Dng serve port=4300
What happens if you change your code while ng serve is running?
AThe app reloads automatically in the browser.
BYou must restart the server manually.
CNothing happens until you refresh the browser.
DThe server crashes.
How do you stop the Angular development server?
ARun ng stop.
BClose the browser tab.
CPress Ctrl + C in the terminal.
DRestart your computer.
Explain the steps and command to run and serve an Angular app locally for development.
Think about how you start, view, and stop the app during development.
You got /5 concepts.
    Describe how you can customize the Angular development server when running it.
    Focus on command options and server behavior.
    You got /4 concepts.