Search code examples
jqueryangularjsnode.jshttp-redirectui-sref

How to call ui-sref inside the node js


In my backend is node js i am using.I want to call ui-sref call inside the node js and redirect the front end(use routes).

I am focusing to go that function

.state('editCompanyProfile',{
                    url:'/editCompanyProfile',
                    controller:'EditProfileCtrl as vm',
                    templateUrl:'auth/register/editCompanyProfileView.html'

                })


Solution

  • In the backend you wouldn't call ui-sref as that's an angular directive and isn't available to your backend logic.

    Instead just do res.redirect('http://yourdomain.com/editCompanyProfile') and you'll accomplish what you're trying to do. If you're not using HTML5 routing, then do res.redirect('http://yourdomain.com/#/editCompanyProfile')