Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/469.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何通过单击特定信息检索值_Javascript_Angularjs_Angularjs Directive_Angularjs Ng Repeat - Fatal编程技术网

Javascript 如何通过单击特定信息检索值

Javascript 如何通过单击特定信息检索值,javascript,angularjs,angularjs-directive,angularjs-ng-repeat,Javascript,Angularjs,Angularjs Directive,Angularjs Ng Repeat,我有一组少数员工的信息,我想通过单击特定员工来显示他们的信息 <md-whiteframe class="md-whiteframe-z1" layout="column" style="background-color:white; margin-top:30px; margin-bottom:30px;" ng-controller="listController"> <div layout="row" ng-repeat="x in names" style="bor

我有一组少数员工的信息,我想通过单击特定员工来显示他们的信息

<md-whiteframe class="md-whiteframe-z1" layout="column" style="background-color:white; margin-top:30px; margin-bottom:30px;" ng-controller="listController">
  <div layout="row" ng-repeat="x in names" style="border-bottom:1px solid #d5d5d5;" ng-click="showAdvanced($event,$index)"> 
     <div class="" layout="column" style="">
        <center class="list-title">
           <img src="/app/img/adnan.jpg" alt="contact image" style="border-radius:50%; height:30px; width:30px; ">
            <span style="margin-left: 8px;font-weight: bold;">{{ x.id }}</span>
           </center>
         </div>

         <div class="" layout="column" style="margin:0px auto;text-align: justify;"> 
           <label for="email" class="list-email" id="popupContainer">{{ x.name }}</label>                            
         </div>

         <div class="" layout="column">
           <label for="phone-no" class="list-phn-no">{{ x.timeStamp }}</label>
         </div>       
       </div>          

 </md-whiteframe>

{{x.id}
{{x.name}
{{x.timeStamp}
这是我的index.html页面,当用户单击该行时,将打开一个我已经完成的选项卡,其中将显示他们的信息。根据员工的情况,信息将发生变化。但我的问题是如何通过单击来检索用户

<md-dialog aria-label="Mango (Fruit)">
 <form>
  <md-dialog-content style="max-width:800px;max-height:810px; color:green;" ng-controller="listController">
   <div>
    <p>
      The mango is a juicy stone fruit belonging to the genus Mangifera, consisting of numerous tropical fruiting trees, cultivated mostly for edible fruit. The majority of these species are found in nature as wild mangoes. They all belong to the flowering plant family Anacardiaceae. The mango is native to South and Southeast Asia, from where it has been distributed worldwide to become one of the most cultivated fruits in the tropics.
    </p>
    <img style="margin: auto; max-width: 100px;" alt="Lush mango tree" src="/app/img/adnan.jpg">
    <p>
      The highest concentration of Mangifera genus is in the western part of Malesia (Sumatra, Java and Borneo) and in Burma and India. While other Mangifera species (e.g. horse mango, M. foetida) are also grown on a more localized basis, Mangifera indica&mdash;the "common mango" or "Indian mango"&mdash;is the only mango tree commonly cultivated in many tropical and subtropical regions.
    </p>
    <p>
      It originated in Indian subcontinent (present day India and Pakistan) and Burma. It is the national fruit of India, Pakistan, and the Philippines, and the national tree of Bangladesh. In several cultures, its fruit and leaves are ritually used as floral decorations at weddings, public celebrations, and religious ceremonies.
    </p>
  </div>
 </md-dialog-content>


芒果是属于芒果属的多汁核果,由许多热带果树组成,主要用于食用果实。这些物种中的大多数是野生芒果。它们都属于有花植物科。芒果原产于南亚和东南亚,在那里它已遍布世界各地,成为热带地区种植最多的水果之一。

芒果属植物最集中的地区是马来西亚西部(苏门答腊、爪哇和婆罗洲)以及缅甸和印度。而其他芒果品种(如马芒果、M.foetida)也在更本地化的基础上种植,如印度芒果&mdash;“普通芒果”或“印度芒果”&mdash;是许多热带和亚热带地区唯一普遍种植的芒果树。

它起源于印度次大陆(现在的印度和巴基斯坦)和缅甸。它是印度、巴基斯坦和菲律宾的国果,也是孟加拉国的国树。在一些文化中,它的果实和叶子在婚礼、公共庆典和宗教仪式上被用作花卉装饰。


这是我想在其中显示要在我的index.html页面上单击的用户的页面。过程是什么

您可以简单地执行此操作,在控制器中注入$modal, 你的点击功能看起来像,你从html发送你的ID

showAdvanced = function (selectedItem) {
    $modal.open({
        templateUrl: 'your template path mean html',
        backdrop: 'static',
        controller: _userCtrl,
        windowClass: 'modal-details',
        resolve: {
            params: function () {
                return { user: selectedItem }
            }
        }
    });
    $event.stopPropagation();

};
您可以将其解析为controller\u userCtrl,如下所示

var _userCtrl = ['$scope', '$modalInstance', 'params', function ($scope, $modalInstance, params) {
  // you received your value in params, you can do it whatever you want, it will in params.user
}];