Skip to content

Commit

Permalink
Add docs for standalone components
Browse files Browse the repository at this point in the history
  • Loading branch information
ashinzekene committed Mar 24, 2024
1 parent bbfab44 commit 60716e2
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 60716e2

Please sign in to comment.