Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tutorial/ng-chapter-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ Now that you've installed the social share plugin, let's look at how to use it.
<b>Exercise</b>: Use the social sharing plugin
</h4>

Open `app/pages/list/list.component.ts` and add the following line at the top of the file, which requires the social share module you just installed:
Open `app/pages/list/list.component.ts` and add the following line at the top of the file, which imports the social share module you just installed:

``` JavaScript
var socialShare = require("nativescript-social-share");
``` TypeScript
import * as SocialShare from "nativescript-social-share";
```

Next you have to build some UI that lets you share a grocery list. To do so, open `app/pages/list/list.html` and add the following code at the very top of the file:
Expand All @@ -187,7 +187,7 @@ ActionBar {
}
```

Finally, now that you’ve installed and required the plugin, and setup a UI to use it, your last step is implementing the `<ActionItem>`'s `tap` handler. Open `app/pages/list/list.component.ts` again and add the following function to the `ListPage` class:
Finally, now that you’ve installed and imported the plugin, and setup a UI to use it, your last step is implementing the `<ActionItem>`'s `tap` handler. Open `app/pages/list/list.component.ts` again and add the following function to the `ListPage` class:


``` TypeScript
Expand All @@ -197,7 +197,7 @@ share() {
list.push(this.groceryList[i].name);
}
let listString = list.join(", ").trim();
socialShare.shareText(listString);
SocialShare.shareText(listString);
}
```

Expand Down