提交 120b226d 编写于 作者: E ester.zhou

Update docs (10129)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 4c842045
...@@ -47,10 +47,11 @@ Starts an ability with the **want** parameter. This API uses an asynchronous cal ...@@ -47,10 +47,11 @@ Starts an ability with the **want** parameter. This API uses an asynchronous cal
```js ```js
let want = { let want = {
"bundleName": "com.example.myapp", 'bundleName': 'com.example.myapp',
"abilityName": "MyAbility"}; 'abilityName': 'MyAbility'
this.context.startAbility(want, (err) => { };
console.log('startAbility result:' + JSON.stringify(err)); this.context.startAbility(want, (err) => {
console.log('startAbility result:' + JSON.stringify(err));
}); });
``` ```
...@@ -79,8 +80,8 @@ Starts an ability with the mandatory **want** and optional **options** parameter ...@@ -79,8 +80,8 @@ Starts an ability with the mandatory **want** and optional **options** parameter
```js ```js
let want = { let want = {
"bundleName": "com.example.myapp", 'bundleName': 'com.example.myapp',
"abilityName": "MyAbility" 'abilityName': 'MyAbility'
}; };
this.context.startAbility(want).then((data) => { this.context.startAbility(want).then((data) => {
console.log('success:' + JSON.stringify(data)); console.log('success:' + JSON.stringify(data));
...@@ -110,15 +111,15 @@ Starts an ability with the **want** and **options** parameters. This API uses an ...@@ -110,15 +111,15 @@ Starts an ability with the **want** and **options** parameters. This API uses an
```js ```js
var want = { var want = {
"deviceId": "", 'deviceId': '',
"bundleName": "com.extreme.test", 'bundleName': 'com.extreme.test',
"abilityName": "MainAbility" 'abilityName': 'MainAbility'
}; };
var options = { var options = {
windowMode: 0, windowMode: 0,
}; };
this.context.startAbility(want, options, (error) => { this.context.startAbility(want, options, (error) => {
console.log("error.code = " + error.code) console.log('error.code = ' + error.code)
}) })
``` ```
...@@ -140,7 +141,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re ...@@ -140,7 +141,7 @@ Terminates this ability. This API uses an asynchronous callback to return the re
```js ```js
this.context.terminateSelf((err) => { this.context.terminateSelf((err) => {
console.log('terminateSelf result:' + JSON.stringify(err)); console.log('terminateSelf result:' + JSON.stringify(err));
}); });
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册