One option is to embed the code directly in the html, and the other better solution is by creating a Component.
1. Embedding code anywhere in the page
This is a familiar option and the easiest way to go. So you can just access the html on any of your Angular files and paste the EmbedSocial code directly.
Here's an example:
2. Creating a Component
There are two steps you need to follow to achieve this:
Create the component
Use the component
1. In the terminal, use the following command `ng generate component EmbedSocialWidget` to create an angular component called `EmbedSocialWidget`
2. After the component is created, open `EmbedSocialWidget.component.ts` and add an `@Input() decorated` string called `refId` just above the constructor.
Your component file `EmbedSocialWidget.component.ts` should look like the image below:
Using the component
The data-ref attribute should look like this:
Once you have the data-ref, you can use the newly created `EmbedSocialWidget` component freely anywhere within your angular project. Just edit the component’s `refId` binding with the refId you copied from EmbedSocial before.
Here's an example of using the component:
Hope this was helpful, and if you have questions or need assistance feel free to reach out and chat with us.
We're happy to help :)