@bitwarden/angular library provides shared Angular-specific code used across the Web, Desktop, and Browser extension clients. It includes reusable components, directives, pipes, and Angular-specific service implementations.
Library Structure
The Angular library is organized by feature domain and Angular artifact type:Components
Directives
Reusable attribute and structural directives for common behaviors
Pipes
Data transformation pipes for templates
Components
Shared UI components used across Angular applications
Guards
Route guards for authentication and authorization
Directives
The Angular library provides several utility directives for common use cases.Feature Flag Directive
Conditionally render elements based on feature flags:Event Handling Directives
Input Directives
Input Strip Spaces
Input Strip Spaces
Automatically removes leading and trailing whitespace from input values:Usage:
Input Verbatim
Input Verbatim
Prevents autocomplete, autocorrect, and other browser input modifications:Usage:
Text Drag
Text Drag
Enables drag-and-drop for text content:Usage:
Other Directives
Pipes
Transformation pipes for displaying data in templates.Search Pipe
Filters arrays based on search terms:User Pipes
Formatting Pipes
Services
Angular-specific service implementations and utilities.Modal Service
Manages modal dialogs across the application:Jslib Services Module
Provides dependency injection configuration for common services:Auth Components & Guards
Authentication Guards
Two-Factor Components
Vault Components
Icon Component
Displays favicons for vault items:Vault Items Component
Billing Components
JslibModule (Deprecated)
TheJslibModule bundles commonly used Angular artifacts, but is deprecated in favor of importing standalone components directly.
JslibModule:
Platform Services
Theme Service
Manages application theming:Import Examples
Best Practices
Prefer Standalone Components
Prefer Standalone Components
New components should be created as standalone to avoid dependency on the deprecated
JslibModule:Use Type-Safe Imports
Use Type-Safe Imports
Import specific directives and pipes rather than importing entire modules:
Follow Angular Style Guide
Follow Angular Style Guide
Follow the official Angular style guide for component architecture, naming conventions, and project structure.
Related Libraries
Components Library
@bitwarden/components - Shared design system componentsCommon Library
@bitwarden/common - Platform-agnostic services and modelsAuth Angular
@bitwarden/auth/angular - Authentication-specific Angular componentsUI Common
@bitwarden/ui-common - Common UI utilities and helpers