1e41f4b71Sopenharmony_ci# Stopping a PageAbility
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ciThe **terminateSelf()** method in the **featureAbility** class is used to stop a PageAbility.
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ci**Table 1** featureAbility APIs
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci| API| Description|
9e41f4b71Sopenharmony_ci| -------- | -------- |
10e41f4b71Sopenharmony_ci| terminateSelf() | Terminates this ability.|
11e41f4b71Sopenharmony_ci| terminateSelfWithResult(parameter: AbilityResult) | Terminates this ability and returns the execution result.|
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ciThe following code snippet shows how to stop an ability.
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci```ts
17e41f4b71Sopenharmony_ciimport featureAbility from '@ohos.ability.featureAbility';
18e41f4b71Sopenharmony_ciimport hilog from '@ohos.hilog';
19e41f4b71Sopenharmony_ci
20e41f4b71Sopenharmony_ciconst TAG: string = 'PagePageAbilityFirst';
21e41f4b71Sopenharmony_ciconst domain: number = 0xFF00;
22e41f4b71Sopenharmony_ci```
23e41f4b71Sopenharmony_ci```ts
24e41f4b71Sopenharmony_ci//...
25e41f4b71Sopenharmony_ci(async (): Promise<void> => {
26e41f4b71Sopenharmony_ci  try {
27e41f4b71Sopenharmony_ci    hilog.info(domain, TAG, 'Begin to terminateSelf');
28e41f4b71Sopenharmony_ci    await featureAbility.terminateSelf();
29e41f4b71Sopenharmony_ci    hilog.info(domain, TAG, 'terminateSelf succeed');
30e41f4b71Sopenharmony_ci  } catch (error) {
31e41f4b71Sopenharmony_ci    hilog.error(domain, TAG, 'terminateSelf failed with ' + error);
32e41f4b71Sopenharmony_ci  }
33e41f4b71Sopenharmony_ci})()
34e41f4b71Sopenharmony_ci//...
35e41f4b71Sopenharmony_ci```
36