0
0
Angularframework~20 mins

Creating a new Angular project - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Angular Project Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
1: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.
Ang init shopApp --routing
Bng generate project shopApp --routing
Cng new shopApp --routing
Dng create shopApp --routing
Attempts:
2 left
💡 Hint
The Angular CLI uses 'ng new' to create projects.
component_behavior
intermediate
1: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.
AMainComponent
BAppComponent
CRootComponent
DHomeComponent
Attempts:
2 left
💡 Hint
The main component is named after the app prefix 'app'.
lifecycle
advanced
2: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.
Aconstructor
BngAfterViewInit
CngOnInit
DngOnChanges
Attempts:
2 left
💡 Hint
The constructor runs before Angular lifecycle hooks.
🔧 Debug
advanced
2: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.
AYou did not enable routing during project creation
BYou used 'ng new' without specifying a project name
CYou ran 'ng serve' outside the project folder
DYou forgot to run 'npm install' to install dependencies
Attempts:
2 left
💡 Hint
Missing node modules usually cause this error.
🧠 Conceptual
expert
2: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.
AIt configures project build and development settings like file paths and build options
BIt lists all installed npm packages and their versions
CIt contains the main HTML template for the app
DIt stores environment variables for production and development
Attempts:
2 left
💡 Hint
Think about what controls how Angular builds and serves your app.