Angular Usage
To use @avatar-generator/angular
in your Angular application, follow these steps to create avatars with Angular components.
Import the Avatar Module
After installing the package, import the AvatarModule
in your Angular module (usually app.module.ts
) to use the avatar component in your templates.
Here’s how you can do it:
Usage Example
Once the module is imported, you can use the avatar component in your Angular templates. Here is an example of how to use the component:
This will render the avatar with the specified options such as name, background color, text color, font size, and shape.
Summary
In this guide, you learned how to use the @avatar-generator/angular
package in your Angular project. The steps include:
- Installing
@avatar-generator/angular
. - Importing the
AvatarModule
into your Angular module. - Using the
<avatar-generator>
component in your templates, passing in properties such asname
,backgroundColor
,textColor
,fontSize
, andshape
to customize the avatar.
By following these steps, you can easily integrate customizable avatars into your Angular application.
This guide demonstrates how to use the Angular component from @avatar-generator/angular
to easily generate avatars in your Angular app.