capacitor-angular

Guides Angular-specific Capacitor integration patterns including services, NgZone listeners, and deep links.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-angular-involvex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: capacitor-angular
Source: https://github.com/involvex/ionic-everywhere/tree/main/.agents/skills/capacitor-angular
Command: npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-angular-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Integrating Capacitor plugins into Angular apps introduces framework-specific pitfalls: plugin event listeners run outside NgZone so the UI never updates, webDir mismatches break syncs, and listeners leak memory without proper lifecycle cleanup. This Skill walks an agent through detecting the project setup and applying the correct Angular patterns. ## Core Features & Use Cases - Project auto-detection: Reads package.json, angular.json, and capacitor.config to determine Angular/Capacitor versions, standalone vs NgModule architecture, and the correct webDir build output path. - Angular plugin patterns: Shows how to wrap Capacitor plugins in injectable services, integrate NgZone.run() for listener callbacks, and manage listener lifecycles with ngOnInit/ngOnDestroy. - Platform workflows: Covers platform detection, deep link routing via Angular Router, Android back button handling, and build/sync/live-reload commands. - Use Case: You add a Network status listener to your Angular app and the template never refreshes — this Skill diagnoses the missing NgZone.run() wrapper and provides the corrected component code. ## Quick Start Ask the agent to add Capacitor to your existing Angular project and wire up a plugin like Camera or Network following Angular service and NgZone best practices.

Frequently Asked Questions about capacitor-angular

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Capacitor plugins in an Angular app?

Import the plugin and call it directly in components, or wrap it in an injectable Angular service for dependency injection and testability. Services provide a single place to handle platform differences using Capacitor.isNativePlatform().

Why is my Angular UI not updating from Capacitor plugin listeners?

Capacitor plugin event listeners run outside Angular's NgZone, so change detection does not trigger. Wrap the listener callback body in NgZone.run(() => { ... }) to ensure template-bound state updates render correctly.

How do I add Capacitor to an existing Angular project?

Install @capacitor/core and @capacitor/cli, run npx cap init, and set webDir to your Angular build output path. For Angular 17+ with the application builder this is dist/<project-name>/browser; older versions use dist/<project-name>.

Does this work with standalone Angular components or only NgModule?

Both architectures are supported. The Skill detects standalone versus NgModule style by checking src/main.ts for bootstrapApplication or platformBrowserDynamic, then adapts service initialization patterns accordingly.

How do I handle deep links in a Capacitor Angular app?

Register an App.addListener('appUrlOpen', ...) callback in a service, wrap it in NgZone.run(), parse the URL path, and call Angular Router's navigateByUrl. Initialize the service at app startup via APP_INITIALIZER or root component injection.

When should I not use this Skill?

Do not use it for creating a new Capacitor app from scratch, upgrading Capacitor major versions, installing specific plugins, Ionic Framework setup, or non-Angular frameworks like React. Dedicated skills cover those scenarios.