【问题标题】:use angularjs ui-router to implement a summary page使用angularjs ui-router 实现摘要页面
【发布时间】:2019-03-01 19:32:38
【问题描述】:

我的网络应用是由 AngularJs+ ui-router 编写的。

网络应用程序包含许多表单(表单的数量会有所不同,具体取决于用户应用的应用程序)。每个表单都有一个 ui-route 状态,因此我们的用户可以转到每个表单并填写信息。

在用户提交应用程序之前,我们希望实现一个“摘要/审查”状态(页面),其中包含用户填写的所有表单,以便用户可以从一个页面查看(和打印)所有信息。有什么方法可以在摘要页面上使用相同的表单模板 (templateUrl)?

我正在考虑使用 ng-include 并以编程方式(ng-repeat)列出所有选定的表单,但它似乎不起作用。

PS:我的表单模板可能使用不同的控制器..

【问题讨论】:

    标签: angularjs angular-ui-router


    【解决方案1】:

    好的,我想通了。

    对于ng-include:我们需要使用

    <ng-include src="'formPath'"></ng-include>

    将 ng-include 放入转发器:

    <div ng-repeat="f in vm.thisApp.RequiredForms">
        <ng-include src="f.FormPath"></ng-include>
    </div>
    

    我希望这对任何需要答案的人有所帮助。

    【讨论】:

      猜你喜欢
      • 2016-07-27
      • 1970-01-01
      • 1970-01-01
      • 2016-09-24
      • 2020-02-06
      • 1970-01-01
      • 2014-07-11
      • 1970-01-01
      • 2016-08-28
      相关资源
      最近更新 更多