This is the development workspace for the ngx-offline-indicator
Angular library.
ngx-offline-indicator
is an Angular library designed to provide developers with a simple and customizable way to inform users about their internet connection status within their Angular applications. This library improves the user experience by providing timely feedback when the application goes offline and offering mechanisms for handling offline scenarios.
- Automatic online/offline detection
- Multiple indicator types (banner, floating, status text)
- Customizable positioning and appearance
- Event hooks for online/offline state changes
- Minimal performance impact
- Easy integration with Angular applications
- projects/ngx-offline-indicator/ - The library source code
- dist/ngx-offline-indicator/ - The built library (after running build command)
- PUBLISHING.md - Detailed instructions for publishing to npm
- USAGE.md - Comprehensive usage guide and examples
npx ng build ngx-offline-indicator
- Build the library:
npx ng build ngx-offline-indicator
- Navigate to the dist folder:
cd dist/ngx-offline-indicator
- Publish to npm:
npm publish
See PUBLISHING.md for detailed publishing instructions.
For detailed usage examples and API documentation, see USAGE.md.
import { NgxOfflineIndicatorComponent } from 'ngx-offline-indicator';
@Component({
selector: 'app-root',
standalone: true,
imports: [CommonModule, NgxOfflineIndicatorComponent],
template: `
<ngx-offline-indicator></ngx-offline-indicator>
<h1>My App</h1>
`,
})
export class AppComponent {}
This project is licensed under the MIT License - see the LICENSE file for details.
To deploy the demo app to Vercel, follow these steps:
-
Install the Vercel CLI:
npm install -g vercel
-
Make sure you're in the project root directory:
cd ngx-offline-indicator-workspace
-
Login to Vercel:
vercel login
-
Deploy the app:
vercel
-
Follow the prompts from the Vercel CLI:
- Set up and deploy project?
Yes
- Which scope to deploy to?
[Select your account]
- Link to existing project?
No
- Project name:
[Enter a name or accept the default]
- Directory to deploy:
./
- Override settings?
No
- Set up and deploy project?
-
Once deployed, Vercel will provide a URL to access your demo app.
-
For production deployment:
vercel --prod
If you encounter build issues during deployment:
-
The deployment uses a custom build script (
vercel-build.js
) to:- First build the library (
ngx-offline-indicator
) - Then build the demo app that depends on the library
- First build the library (
-
If you see errors about missing dependencies, try adding them to the root
package.json
. -
For path resolution issues, check the
paths
configuration inprojects/demo-app/tsconfig.app.json
.