使用angularjs动态加载弹出窗口中的内容

时间:2015-09-04 10:58:47

标签: angularjs angularjs-directive angularjs-ng-repeat

如何在弹出窗口中根据单击的div动态加载我的json数据。

我的代码在这里:

<div class="col-xs-12 col-sm-6 col-lg-4 checkContent" ng-repeat = "appreciate in CustAppre" ng-click = "openBigDiv()">
                    <div class="quote-inner-wrapper">   
                        <div class="arrow_box blue-texture-bg custApprPopOver">
                            <blockquote class="no-bg white quotation-white">
                                <p>{{appreciate.appre}}</p>
                                <span class = "hideContent">{{appreciate.custContent}}</span>
                            </blockquote>
                        </div>
                        <a role="button" class="customerName blue" href="#">{{appreciate.by}}</a>        
                    </div>
                </div>

控制器:

$scope.CustAppre = [        
    {appre:"Project Appreciation",by:"Ziva Roe",custContent:"You are doing a very good job"},
    {appre:"Agile Work Process",by:"Joe Roe",custContent:"You are doing a very good job"},
    {appre:"Customer Speaks",by:"Michael Charles",custContent:"You are doing a very good job"},
    {appre:"Work Appreciation",by:"Gwen Charles",custContent:"You are doing a very good job"},
    {appre:"Leadership Appreciation",by:"Joe Roe",custContent:"You are doing a very good job"},
    {appre:"Agile Appreciation",by:"Sherlee James",custContent:"You are doing a very good job"},        
    ];

1 个答案:

答案 0 :(得分:0)

在按钮上,您可以使用打开div的功能

<button type='button' class="customerName blue" ng-click="myfunction(appreciate.by)"> {{appreciate.by}} </button>

使用该按钮代替链接,以便于理解:)

在控制器中,您可以进行比较,或者您需要在弹出窗口中显示数据。