提交 2266c93e 编写于 作者: X xuzhihao

Fix example error code & format of Ability

Signed-off-by: Nxuzhihao <xuzhihao16@huawei.com>
上级 2e809106
......@@ -34,7 +34,7 @@ startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\<number>)
import featureAbility from '@ohos.ability.featureAbility'
import wantConstant from '@ohos.ability.wantConstant'
featureAbility.startAbility(
{
{
want:
{
action: "",
......@@ -85,7 +85,7 @@ featureAbility.startAbility(
uri: ""
},
}
).then((data) => {
).then((data) => {
console.info("==========================>startAbility=======================>");
});
```
......@@ -153,6 +153,9 @@ featureAbility.startAbilityForResult(
uri:""
},
},
(err, data) => {
console.info("err: " + JSON.stringfy(err) + "data: " + JSON.stringfy(data))
}
)
```
......@@ -407,7 +410,7 @@ getWant(): Promise\<Want>
```javascript
import featureAbility from '@ohos.ability.featureability';
featureAbility.getWant().then((data) => {
console.info("==========================>getWantCallBack=======================>");
console.info("==========================>getWantCallBack=======================>");
});
```
......@@ -476,7 +479,8 @@ terminateSelf(): Promise\<void>
```javascript
import featureAbility from '@ohos.ability.featureability';
featureAbility.terminateSelf().then((data) => { console.info("==========================>terminateSelfCallBack=======================>");
featureAbility.terminateSelf().then((data) => {
console.info("==========================>terminateSelfCallBack=======================>");
});
```
......@@ -591,7 +595,7 @@ var connId = featureAbility.connectAbility(
);
var result = featureAbility.disconnectAbility(connId,
(error,data) => {
console.log('featureAbilityTest DisConnectJsSameBundleName result errCode : ' + error.code + " data: " + data)
console.log('featureAbilityTest DisConnectJsSameBundleName result errCode : ' + error.code + " data: " + data)
},
);
```
......@@ -642,7 +646,7 @@ var connId = featureAbility.connectAbility(
},
);
featureAbility.disconnectAbility(connId).then((error,data)=>{
featureAbility.disconnectAbility(connId).then((error,data) => {
console.log('featureAbilityTest result errCode : ' + error.code + " data: " + data);
});
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册