From 60716e2c72643851cdcc683ddf66608d0f87b1c4 Mon Sep 17 00:00:00 2001 From: Ekene Ashinze Date: Sun, 24 Mar 2024 09:26:13 -0700 Subject: [PATCH] Add docs for standalone components --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 2c119d7..e8da5c3 100755 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ npm install --save angular4-paystack ``` ### 2. Import the module +#### For NgModule components: In your `app.module.ts` or any module where the component or directive would be used like so: ```ts @@ -31,6 +32,27 @@ import { Angular4PaystackModule } from 'angular4-paystack'; export class AppModule {} ``` +#### For standalone components: +Import the providers into your global app config: + +```ts +bootstrapApplication(AppComponent, { + importProvidersFrom(Angular4PaystackModule.forRoot('pk_test_xxxxxxxxxxxxxxxxxxxxxxxx')) +}) + .catch((err) => console.error(err)); +``` + +And then import the directives when needed in your component: +```ts +@Component({ + selector: 'app-root', + standalone: true, + imports: [Angular4PaystackModule], + templateUrl: './app.component.html', + styleUrl: './app.component.css' +}) +``` + ### 3. Implement in your project There are two available options