NativeScript / nativescript-sdk-examples-ng

NativeScript and Angular code samples.
Apache License 2.0
291 stars 295 forks source link

UI Documentation for Alert incorrect #448

Closed enstenr-zz closed 4 years ago

enstenr-zz commented 4 years ago

Documentation page says I can use the alert function like the below https://docs.nativescript.org/angular/ui/ng-components/dialogs#confirm-dialog

let options = { title: "Race selection", message: "Are you sure you want to be a Unicorn?", okButtonText: "Yes", cancelButtonText: "No", neutralButtonText: "Cancel" };

confirm(options).then((result: boolean) => { console.log(result); });

But angular does not allow me

error TS2345: Argument of type '{ title: string; message: string; okButtonText: string; cancelButtonText: string; neutralButtonText: string; }' is not assignable to parameter of type 'string'.

enstenr-zz commented 4 years ago

Ignore this. I had to import confirm manually from the package. import * was showing me error though.

Still I am not able to view the console log after dialog is closed. will check it myself.