triniwiz / nativescript-popup

Apache License 2.0
22 stars 17 forks source link

Problem with navigateByUrl in Angular #9

Open jibon57 opened 6 years ago

jibon57 commented 6 years ago

Hi,

Thanks for the excellent plugin. I was trying it in my Angular project with NativeScript 4.0.0. Everything was working great except when I was trying to navigate to another page from tap event of the listed item, that time I am getting only white page.

private _showPopup(source, view) {
        this.popup = new Popup({
            height: 50,
            width: 40,
            unit: '%',
            elevation: 10,
            borderRadius: 25
        });
        this.popup.showPopup(source, view).then(data => {
            //console.log(data);
        });
    }
    private hidePopup(index?) {
        let t = this;
        this.popup.hidePopup(index)
    }
public openPopUp() {
        let t = this;
        const stack: StackLayout = new StackLayout();
        stack.paddingTop = 30;
        stack.paddingLeft = 30;
        stack.height = "auto";

const lbl4: Label = new Label();
        lbl4.text = 'Profile';
        lbl4.marginBottom = 5;
        lbl4.marginLeft = 8;
        lbl4.height = 40;
        lbl4.on("tap", function () {
            t.routerExt.navigateByUrl("/login");

        })
        stack.addChild(lbl4);

        const sv = new ScrollView();
        sv.content = stack;
        this._showPopup(this.page.getViewById('profile'), sv);
}

Any hints in where I am doing mistake?

Thanks

triniwiz commented 6 years ago

Have you tried closing the popup when you navigate

jibon57 commented 6 years ago

@triniwiz Thanks for your quick response. Yes, I tried that too like this:

t.hidePopup();
setTimeout(() => {
       t.routerExt.navigateByUrl("/login");     
}, 500);

But no luck :(

triniwiz commented 6 years ago

Any error?

On Wednesday, April 18, 2018, 1:38 PM, Jibon Lawrence Costa notifications@github.com wrote:

@triniwiz Thanks for your quick response. Yes, I tried that too like this: t.hidePopup(); setTimeout(() => { t.routerExt.navigateByUrl("/login");
}, 500);

But no luck :(

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub, or mute the thread.

jibon57 commented 6 years ago

Actually not error but blank page like this

image

triniwiz commented 6 years ago

Try subscribing to the router and see what page you are on

On Wednesday, April 18, 2018, 1:49 PM, Jibon Lawrence Costa notifications@github.com wrote:

Actually not error but blank page like this

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub, or mute the thread.

jibon57 commented 6 years ago

@triniwiz will you please give some hints to do so?

Thanks

jibon57 commented 6 years ago

@triniwiz I tried to check where it's going to that login page or not. I saw it isn't displaying any contents if I tried to display any data. So, I ain't sure if that is really going to appropriate page or not.

jibon57 commented 6 years ago

@triniwiz Any hints to solve this problem?