You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/spfx/extensions/get-started/build-a-hello-world-extension.md
+42-4Lines changed: 42 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Build your first SharePoint Framework Extension (Hello World part 1)
3
3
description: Create an extension project, and then code and debug your Application Customizer.
4
-
ms.date: 10/1/2020
4
+
ms.date: 10/2/2020
5
5
ms.prod: sharepoint
6
6
localization_priority: Priority
7
7
ms.custom: scenarios:getting-started
@@ -66,15 +66,39 @@ You can also follow the steps in this article by watching the video on the Share
66
66
67
67
This file defines your extension type and a unique identifier for your extension. You’ll need this ID later when you debug and deploy your extension to SharePoint.
Open the **./src/extensions/helloWorld/HelloWorldApplicationCustomizer.ts** file.
74
91
75
92
Notice that base class for the Application Customizer is imported from the **\@microsoft/sp-application-base** package, which contains SharePoint framework code required by the Application Customizer.
76
93
77
-

94
+
```typescript
95
+
import { override } from '@microsoft/decorators';
96
+
import { Log } from '@microsoft/sp-core-library';
97
+
import {
98
+
BaseApplicationCustomizer
99
+
} from '@microsoft/sp-application-base';
100
+
import { Dialog } from '@microsoft/sp-dialog';
101
+
```
78
102
79
103
The logic for your Application Customizer is contained in the `onInit()` method, which is called when the client-side extension is first activated on the page. This event occurs after `this.context` and `this.properties` are assigned. As with web parts, `onInit()` returns a promise that you can use to do asynchronous operations.
80
104
@@ -83,7 +107,21 @@ The logic for your Application Customizer is contained in the `onInit()` method,
83
107
84
108
The following are the contents of `onInit()` in the default solution. This default solution writes a log to the Dev Dashboard, and then displays a simple JavaScript alert when the page renders.
85
109
86
-

Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`);
121
+
122
+
returnPromise.resolve();
123
+
}
124
+
```
87
125
88
126
> [!NOTE]
89
127
> **SharePoint Framework Dev Dashboard** is additional UI dashboard, which can be started with <kbd>CTRL</kbd>+<kbd>F12</kbd> on Windows. This is developer oriented logging information, which you can take advantage as developer.
0 commit comments