How to redirect to another page using AngularJS?

前端 未结 12 673
深忆病人
深忆病人 2020-11-27 11:04

I am using ajax call to perform functionality in a service file and if the response is successful, I want to redirect the page to another url. Currently, I am doing this by

12条回答
  •  猫巷女王i
    2020-11-27 11:57

    If you want to use a link then: in the html have:

    
    

    in the typescript file

    public openLineItems() {
    if (this.$stateParams.id == 0) {
        this.Flash.create('warning', "Need to save order!", 3000);
        return
    }
    this.$window.open('#/orderLineitems/' + this.$stateParams.id);
    

    }

    I hope you see this example helpful as it was for me along with the other answers.

提交回复
热议问题