• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Starting a Local PageAbility
2
3
4The capabilities related to the PageAbility are provided through the **featureAbility** class. For example, **startAbility()** in **featureAbility** is used to the PageAbility.
5
6**Table 1** featureAbility APIs
7
8| API| Description|
9| -------- | -------- |
10| startAbility(parameter: StartAbilityParameter) | Starts an ability.|
11| startAbilityForResult(parameter: StartAbilityParameter) | Starts an ability and returns the execution result when the ability is terminated.|
12
13
14The following code snippet shows how to explicitly start a PageAbility through **startAbility()**. The parameters passed in for starting an ability include **want**. For details about the **want** parameter as well as implicit startup and explicit startup, see [Want](want-fa.md).
15
16```ts
17import featureAbility from '@ohos.ability.featureAbility'
18(async () => {
19  try {
20    console.info('Begin to start ability')
21    let param = {
22      want: {
23        bundleName: "com.example.myapplication",
24        moduleName: "entry",
25        abilityName: "com.example.myapplication.EntryAbility"
26      }
27    }
28    await featureAbility.startAbility(param)
29    console.info(`Start ability succeed`)
30  }
31  catch (error) {
32    console.error('Start ability failed with ' + error)
33  }
34})()
35```
36