Bird
0
0

After running ng new test-app --routing --style=css and then cd test-app followed by ng serve, what will happen?

medium📝 component behavior Q13 of 15
Angular - Fundamentals
After running ng new test-app --routing --style=css and then cd test-app followed by ng serve, what will happen?
AThe app will fail to compile due to missing routing module
BThe Angular app will compile and be available at http://localhost:4200
CThe app will compile but show a blank page because CSS is not supported
DThe command will throw an error because 'ng serve' must be run before 'cd test-app'
Step-by-Step Solution
Solution:
  1. Step 1: Understand Angular CLI workflow

    Creating a project with routing and CSS style is valid. Changing directory into the project folder is required before serving.
  2. Step 2: What ng serve does

    ng serve compiles and launches a local server at port 4200 by default, showing the app in the browser.
  3. Final Answer:

    The Angular app will compile and be available at http://localhost:4200 -> Option B
  4. Quick Check:

    ng serve runs app at localhost:4200 [OK]
Quick Trick: Run ng serve inside project folder to view app in browser [OK]
Common Mistakes:
  • Running ng serve outside project folder
  • Assuming CSS is unsupported
  • Expecting errors from valid routing option

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Angular Quizzes