opened
rclai
username_0
[This example code](https://docs.nativescript.org/ui-dialogs#page-as-custom-modal-dialog):

```js
var pages = require("ui/page");
var activityIndicator = require("ui/activity-indicator");

var p = new pages.Page();
var ai = new activityIndicator.ActivityIndicator();
ai.busy = true
p.content = ai;
p.showModal();

setTimeout(function () { p.closeModal(); }, 1000);
```

Even with no arguments passed into it, [this line of code](https://github.com/NativeScript/NativeScript/blob/481053e668e36c98d3f8c69217a23b5e84fbb27c/ui/page/page-common.ts#L203) is being hit, throwing an error.
Example modal code breaks
issue
created
hshristov
username_1
Hi @username_0,

there is no showModal method without arguments. It is like you have a page and on that page you call showModal('urlToModalPage') to show the specified page as modal.

See the docs:
https://docs.nativescript.org/ApiReference/ui/page/Page.html
comment
closed
hshristov
username_1
issue
created
rclai
username_0
Oh so [this example code](https://docs.nativescript.org/ui-dialogs#page-as-custom-modal-dialog) is wrong then.
comment
created
dragGH102
username_2
@username_0 The example is not about modals, but dialogs
comment