@@ -38,10 +40,10 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/
Scenario 1: Create a [WantAgentInfo](../reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md) object for starting a UIAbility component.
```typescript
letwantAgentObj=null;// Save the WantAgent object created. It will be used to complete the trigger operations.
letwantAgentObj:WantAgent=null;// Save the WantAgent object created. It will be used to complete the trigger operations.
// Set the action type through operationType of WantAgentInfo.
letwantAgentInfo={
letwantAgentInfo:wantAgent.WantAgentInfo={
wants:[
{
deviceId:'',
...
...
@@ -62,10 +64,10 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/
Scenario 2: Create a [WantAgentInfo](../reference/apis/js-apis-inner-wantAgent-wantAgentInfo.md) object for publishing a [common event](../application-models/common-event-overview.md).
```typescript
letwantAgentObj=null;// Save the WantAgent object created. It will be used to complete the trigger operations.
letwantAgentObj:WantAgent=null;// Save the WantAgent object created. It will be used to complete the trigger operations.
// Set the action type through operationType of WantAgentInfo.
letwantAgentInfo={
letwantAgentInfo:wantAgent.WantAgentInfo={
wants:[
{
action:'event_name',// Set the action name.
...
...
@@ -82,7 +84,7 @@ For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/