redirect by routing in angularjs

前端 未结 1 1613
忘掉有多难
忘掉有多难 2021-02-05 03:44

i have the following requirement: a list should be displayed for all items with edit and delete link. when user clicks on edit, edit form should appear with textboxes and a save

1条回答
  •  盖世英雄少女心
    2021-02-05 04:40

    You need to inject the $location service in your editCtrl controller.

    Then, in your save function add the following to do the redirect (note that the path matches your route).

    $scope.save = function (...) {
        // ...
        $location.path('/productapp');
    }
    

    This Youtube video might also help you.

    0 讨论(0)
提交回复
热议问题