提交 d1271d45 编写于 作者: W wusongqing

update docs against 8755+8556

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 fb498bc2
......@@ -86,7 +86,7 @@ To create Page abilities for an application in the stage model, you must impleme
onWindowStageCreate(windowStage) {
console.log("MainAbility onWindowStageCreate")
windowStage.loadContent("pages/index").then((data) => {
windowStage.loadContent("pages/index").then(() => {
console.log("MainAbility load content succeed")
}).catch((error) => {
console.error("MainAbility load content failed with error: "+ JSON.stringify(error))
......@@ -227,8 +227,8 @@ var want = {
"bundleName": "com.example.MyApplication",
"abilityName": "MainAbility"
};
context.startAbility(want).then((data) => {
console.log("Succeed to start ability with data: " + JSON.stringify(data))
context.startAbility(want).then(() => {
console.log("Succeed to start ability")
}).catch((error) => {
console.error("Failed to start ability with error: "+ JSON.stringify(error))
})
......@@ -244,8 +244,8 @@ var want = {
"bundleName": "com.example.MyApplication",
"abilityName": "MainAbility"
};
context.startAbility(want).then((data) => {
console.log("Succeed to start remote ability with data: " + JSON.stringify(data))
context.startAbility(want).then(() => {
console.log("Succeed to start remote ability")
}).catch((error) => {
console.error("Failed to start remote ability with error: " + JSON.stringify(error))
})
......
......@@ -126,7 +126,7 @@ var options = {
windowMode: 0,
};
this.context.startAbility(want, options)
.then((data) => {
.then(() => {
console.log('Operation successful.')
}).catch((error) => {
console.log('Operation failed.');
......@@ -273,7 +273,7 @@ var options = {
};
var accountId = 11;
this.context.startAbility(want, accountId, options)
.then((data) => {
.then(() => {
console.log('Operation successful.')
}).catch((error) => {
console.log('Operation failed.');
......@@ -352,7 +352,7 @@ Starts an ability with **options** specified. This API uses a promise to return
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-featureAbility.md#Want) | Yes| Information about the **Want** used for starting an ability.|
| options | StartOptions | Yes| Parameters used for starting the ability.|
| options | StartOptions | No | Parameters used for starting the ability.|
**Return value**
......@@ -511,8 +511,8 @@ Terminates this ability. This API uses a promise to return the result.
**Example**
```js
this.context.terminateSelf(want).then((data) => {
console.log('success:' + JSON.stringify(data));
this.context.terminateSelf(want).then(() => {
console.log('success:');
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
......@@ -571,7 +571,7 @@ this.context.terminateSelfWithResult(
{
want: {bundleName: "com.extreme.myapplication", abilityName: "MainAbilityDemo"},
resultCode: 100
}).then((result) => {
}).then(() => {
console.log("terminateSelfWithResult")
})
```
......@@ -768,8 +768,8 @@ Sets the label of the ability in the mission. This API uses a promise to return
**Example**
```js
this.context.setMissionLabel("test").then((data) => {
console.log('success:' + JSON.stringify(data));
this.context.setMissionLabel("test").then(() => {
console.log('success:');
}).catch((error) => {
console.log('failed:' + JSON.stringify(error));
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册