Sharing information across application boundaries using the platform provider scope
We can demonstrate how to share information outside of the app by creating a tweet button as an Angular element. This Angular element could be used outside of the app as well. Let's dig into the details on how to do that.
First, we will start by adding Angular elements to the app by running the following command:
ng add i @angular/elements
Then we include the Twitter widgets SDK within the page like this:
<script src="https://platform.twitter.com/widgets.js" type="text/javascript" ></script
Then we can build a tweet hashtag button using a TweetCourse
component like this:
<ng-container *ngIf="course$ | async as course"> <a href="https://twitter.com/intent/tweet?button_hashtag= &...