Angular Development Environment (angular-dev)
Angular Development Environment (angular-dev)
Section titled “Angular Development Environment (angular-dev)”Angular-specific development environment with VS Code extensions and CLI autocompletion.
Features
Section titled “Features”- VS Code extensions: Essential Angular development extensions pre-installed
- CLI autocompletion: Tab completion for Angular CLI commands in zsh and bash
- Optional CLI installation: Install Angular CLI globally if needed
Add this feature to your devcontainer.json:
With Port Forwarding (Recommended)
Section titled “With Port Forwarding (Recommended)”For the best development experience, add port forwarding for the Angular dev server:
With Angular CLI installation
Section titled “With Angular CLI installation”If you want to install Angular CLI as part of this feature:
Recommended setup with Node.js
Section titled “Recommended setup with Node.js”Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
installCli | boolean | false | Install Angular CLI globally |
VS Code Extensions Included
Section titled “VS Code Extensions Included”| Extension | Description |
|---|---|
angular.ng-template | Angular Language Service |
johnpapa.angular2 | Angular Snippets |
infinity1207.angular2-switcher | Switch between component files |
alexiv.vscode-angular2-files | Generate Angular files |
obenjiro.arrr | Angular Refactoring Tools |
john-crowson.angular-file-changer | Quick file navigation |
cyrilletuzi.angular-schematics | Angular Schematics integration |
Port Configuration
Section titled “Port Configuration”The Angular dev server runs on port 4200 by default. Since DevContainer features cannot configure port forwarding directly, you need to add it to your devcontainer.json:
| Port | Purpose | Recommended Action |
|---|---|---|
| 4200 | Angular Dev Server | Add to forwardPorts in devcontainer.json |
CLI Autocompletion
Section titled “CLI Autocompletion”Angular CLI autocompletion is automatically configured for both zsh and bash shells. After the container starts, you can use tab completion for:
ng <tab>- Show available commandsng generate <tab>- Show schematic typesng add <tab>- Show available packages
Working with Angular
Section titled “Working with Angular”Create a new application
Section titled “Create a new application”Generate components
Section titled “Generate components”Build for production
Section titled “Build for production”Troubleshooting
Section titled “Troubleshooting”Angular CLI not found
Section titled “Angular CLI not found”If ng command is not available:
- Ensure Node.js feature is installed before this feature
- Set
installCli: truein the feature options - Or install manually:
npm install -g @angular/cli
Autocompletion not working
Section titled “Autocompletion not working”- Start a new terminal session after container creation
- Ensure you’re using zsh or bash shell
- Check that Angular CLI is installed:
which ng
Port 4200 not accessible
Section titled “Port 4200 not accessible”- Ensure
forwardPorts: [4200]is in yourdevcontainer.json - Check if another process is using port 4200
- Verify the dev server is running:
ng serve - Check VS Code’s Ports panel for forwarding status