-
-
Notifications
You must be signed in to change notification settings - Fork 240
Closed
@tsonevn
Description
From @victorhurdugaci on July 4, 2016 20:11
-
tns create DialogTest --ng -
Change
app.component.tsto:import {Component} from "@angular/core"; import {ModalDialogService, ModalDialogOptions, ModalDialogHost, ModalDialogParams} from "nativescript-angular/modal-dialog"; import * as dialogs from "ui/dialogs"; @Component({ selector: "my-app", directives: [ModalDialogHost], providers: [ModalDialogService], template: ` <StackLayout modal-dialog-host> <Button text="Show" (tap)="onTap()"></Button> <ListView [items]="items" class="small-spacing" > <template let-item="item" > <GridLayout columns="*, *" rows="auto"> <Label class="scoreline-text" [text]="item" col="0"></Label> <Button text="Show" (tap)="onTap()" col="1"></Button> </GridLayout> </template> </ListView> </StackLayout>` }) export class AppComponent { constructor(private modalService: ModalDialogService) { } public get items(): string[] { return ['a', 'b', 'c']; } public onTap() { console.log('show dialog'); this.modalService.showModal(MyDialog, {}) } } @Component({ template: `<Label text="Hello"></Label>` }) class MyDialog { constructor(private params: ModalDialogParams) { } }
-
tns livesync android --watch -
When the app starts tap the first
Showbutton that's outside of the list view and notice that the dialog shows up. -
Try tapping one of the buttons in the list view and notice that the dialog doesn't show up even thought it calls in the same event handler (you can even see the console log output).
- CLI: 2.1.0
- core modules: 2.1.0
- tns-android: 2.1.1
- OS: Win 10 x64
- Emulator: Genymotion
Copied from original issue: NativeScript/NativeScript#2416