如何在每次单击按钮时显示<div>

时间:2015-08-05 15:55:24

标签: html angularjs

如何展示<Div&gt;每次点击<Button>。 以下是我的默认<Div>,它有Add按钮。

默认Div始终可见。但是当用户单击“添加”按钮时,新的div应显示在默认div下,依此类推.... If user clicks Add button 5 times than 5 <Div> should show with same controls/inputs under default <Div>.

有什么建议吗?

代码:

<div class="panel-body form-horizontal">
    <button ng-click="addStudent = true" class="btn btn-primary">
        Add new Student
    </button>

    <div class="form-group">
        <label class="col-lg-2 control-label required">Roll No.</label>
        <div class="col-lg-4">
            <input type="text" id="rollNo" name="runNumber" class="form-control" data-ng-model="RollNumber" ng-required="true" maxlength="100" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-2 control-label">Student Name</label>
        <div class="col-lg-4">
            <input type="text" name="studentName" class="form-control" data-ng-model="StudentName" maxlength="500" />
        </div>
    </div>

    <div class="form-group">
        <label class="col-lg-2 control-label">Class Name</label>
        <div class="col-lg-4">
            <input type="text" name="Class" class="form-control" data-ng-model="ClassName" maxlength="500" />
        </div>
    </div>
</div>

0 个答案:

没有答案