angularjs - UI Router redirect on form success -
I use the UI router in my AngularJS app when the form is posted, then I want to load another page .
I have tried the code below. The console.lag (data) works fine, but nothing happens with $ state.go ('brand')
There is no error.
$ http ({... .vivet (function) {console.log (data); $ state.go ('brand');})
Update! Solution . The form submission was done in a model and was not hidden when a new page was loaded:
$ ('# Confirm_delete'). ('Hide'); $ ('# confirm_delete'). ('Hidden.b.s.model', work (e) {$ state.go ("brand");})
This scenario should work. Against < Code> UI-Router states. I made an example Or Lt; / p & gt;" })}])); And here's a controller, with the send operation ... redirected to the brand state Check it and you will see that it's working (this model uses to send but ... this will apply to the post). Check it out
app.controller ('MainCtrl', [' $ Scope ', $ $ Http', '$ state', function ($ radius, $ http, $ state) {$ scope.user = {name: "John"} $ scope.send = function () {$ http Get ("Dummy.json", {params: $ scope.user}) .success (function (data) {$ state.go ("brand");})}}]));
Comments
Post a Comment