将div设为点击模型

时间:2015-09-07 07:29:23

标签: angularjs angularjs-ng-repeat

我的问题是我需要在点击时打开div,其中所有数据都以popup / modal淡化背景。

HTML:

<div ng-app = "angulo" ng-controller="testController">

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

    </div>

控制器:

var app = angular.module('angulo', []);
app.controller('testController', function ($scope, $location, $rootScope, $log) {

$scope.CustAppre = [        
{title:"Project Appreciation",by:"Ziva Roe",content:"1 popup good job"},
{title:"Agile Work Process",by:"Joe Roe",content:"2 pop up very good job"},
{title:"Customer Speaks",by:"Michael Charles",content:"3 popup a very good job"},
];

$scope.openBigDiv = function(title) {
title.opened = !title.opened;
    };

});

这是我的小提琴。请指教。

https://jsfiddle.net/f98engoa/11/

0 个答案:

没有答案