Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to install Angular CLI globally using npm.
Angular
npm install -g [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'angular-cli' instead of '@angular/cli'.
Trying to install 'ng-cli' which is not the official package.
✗ Incorrect
The correct package name to install Angular CLI globally is @angular/cli.
2fill in blank
mediumComplete the command to create a new Angular project named 'my-app'.
Angular
ng [1] my-app Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ng start', which is not a valid command ('ng serve' runs the development server).
Using 'ng create' which is not a valid Angular CLI command.
✗ Incorrect
The Angular CLI command to create a new project is ng new.
3fill in blank
hardFix the error in the command to serve the Angular app on port 4201.
Angular
ng serve --port=[1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the default port 4200 instead of 4201.
Using a port number unrelated to Angular defaults.
✗ Incorrect
The default port is 4200, but to serve on port 4201 you specify --port=4201.
4fill in blank
hardFill both blanks to install Angular CLI locally and check its version.
Angular
npm [1] @angular/cli && npx ng [2] --version
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'npm update' instead of 'npm install' for initial install.
Using 'v' instead of 'version' for the version command.
✗ Incorrect
Use npm install to install packages and npx ng version to check Angular CLI version.
5fill in blank
hardFill all three blanks to create a new Angular project with routing and SCSS style.
Angular
ng new my-app --[1] --style=[2] --skip-[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'css' instead of 'scss' for styles.
Forgetting to add routing option.
Not skipping tests when desired.
✗ Incorrect
Use --routing to add routing, --style=scss for SCSS styles, and --skip-tests to skip test files.