Challenge - 5 Problems
Angular Project Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate1:30remaining
What is the correct command to create a new Angular project named 'shopApp' with routing enabled?
Choose the exact Angular CLI command that creates a new project called shopApp and sets up routing.
Attempts:
2 left
💡 Hint
The Angular CLI uses 'ng new' to create projects.
✗ Incorrect
The correct command to create a new Angular project with routing is 'ng new shopApp --routing'. Other commands are invalid or do not create projects.
❓ component_behavior
intermediate1:30remaining
After creating a new Angular project, what is the default component rendered when you run 'ng serve'?
Identify which component Angular shows by default in the browser after running 'ng serve' on a fresh project.
Attempts:
2 left
💡 Hint
The main component is named after the app prefix 'app'.
✗ Incorrect
Angular generates an AppComponent by default, which is the root component rendered in the browser.
❓ lifecycle
advanced2:00remaining
Which lifecycle hook runs first in the root component after creating a new Angular project and starting the app?
Select the lifecycle hook that Angular calls first in the root component when the app loads.
Attempts:
2 left
💡 Hint
The constructor runs before Angular lifecycle hooks.
✗ Incorrect
The constructor of the component class runs first, before Angular calls lifecycle hooks like ngOnInit.
🔧 Debug
advanced2:00remaining
You created a new Angular project but running 'ng serve' shows 'Cannot find module @angular/core'. What is the most likely cause?
Identify the main reason for this error after creating a new Angular project and trying to serve it.
Attempts:
2 left
💡 Hint
Missing node modules usually cause this error.
✗ Incorrect
The error means Angular packages are missing. Running 'npm install' installs them. Other options do not cause this error.
🧠 Conceptual
expert2:30remaining
What is the purpose of the 'angular.json' file created in a new Angular project?
Choose the best description of what the 'angular.json' file controls in an Angular project.
Attempts:
2 left
💡 Hint
Think about what controls how Angular builds and serves your app.
✗ Incorrect
The 'angular.json' file defines how Angular builds, serves, and tests the project, including file locations and build options.