Angularjs 角度重定向到其他页面并返回到原始页面

Angularjs 角度重定向到其他页面并返回到原始页面,angularjs,redirect,routing,Angularjs,Redirect,Routing,我的代码如下: 我有A、B和C的路由。因此它们有单独的URL,即localhost:8080/A、localhost:8080/B和localhost:8080/C $stateProvider.state('A', {url:'/A', template:..., controller:...}) .state('B', {url:'/B', template:..., controller:...}) .state('C', {url:

我的代码如下: 我有A、B和C的路由。因此它们有单独的URL,即localhost:8080/A、localhost:8080/B和localhost:8080/C

$stateProvider.state('A', {url:'/A', template:..., controller:...})
              .state('B', {url:'/B', template:..., controller:...})
              .state('C', {url:'/C', template:..., controller:...})
当我在localhost:8080/A上时,有一个包含4个步骤的支付流程。 这是我处理付款流程的方式:

<div ng-show="step == 1">
   ...
</div>
<div ng-show="step == 2">
   ...
</div>
<div ng-show="step == 3">
   ...
</div>
<div ng-show="step == 4">
   ...
</div>

...
...
...
...
当我在第3步时,我需要向第三方发送一个带有URL的请求(如果验证成功,它将转到该URL)以验证信用卡,并跳转到他们的页面,如果验证成功,页面应返回到原始页面(localhost上的第3步:8080/a)

如何做到这一点?因为步骤3没有唯一的URL。我知道的唯一选择是为step3创建一个唯一的URL,即localhost:8080/step3。然后,我需要做大量的工作来从a检索HTML以及控制器代码。
有更好的解决方案吗?

添加一个子状态,该子状态在url中具有
/:step
,而不是使用
ng show
。使用
$stateParams.step
确定它是哪一步,从而确定模板url或甚至要显示的内容再次通过ui路由器演示和文档查看这是如何完成的,并在url中添加一个子状态
/:step
,而不是使用
ng show
。使用
$stateParams.step
确定它是哪一步,从而确定模板URL,甚至是要显示的内容再次通过ui路由器演示和文档查看如何完成此操作