如何访问用户名了NG-重复 [英] How to access the username out of a ng-repeat

查看:159
本文介绍了如何访问用户名了NG-重复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有NG重复和数据从数据库,工作正常生成的用户列表。现在,当你点击一个用户,你会得到一个弹出框。我想显示这个弹出框中选择的用户名,但我不知道如何访问的用户名,因为NG重复不会发生在弹出的对话框。

I have a list of users generated with ng-repeat and data from db, which works fine. Now when you click on a user, you get a popup box. I would like to display the name of the selected user in this popup box, but I don't know how to access the username because the ng-repeat does not take place in the popup box.

请注意,我用的角材工作。

Note that I work with angular material

我的html code的部分:

Part of my html code:

<!-- START SIDEBAR -->
    <div id="logo-wrap">
      <img id="logo" src="assets/images/logo2.png" alt="Zazzle Logo" >
    </div>
    <div id="sidebar" class="md-whiteframe-z4" ng-data-color="">
      <div style="height: 80px;"></div>
      <div class="userList" id="usrL">
        <li id="customLI" ng-repeat="user in users" id="userPos" class="active circular md-whiteframe-z2" style="background-color: {{ user.color }} " ng-click="showPopUpDeletionConfirmation($event, user._id); " ng-data-id="{{ user._id }}">
          <div ng-if="user._id==activeUser" class="wrapperImageCurrentUser" id="marker_active_user"> </div>
          <p class="initials" id="userValue" style="top: {{ user.top }};" >
            <custom id="user._id"></custom>
            {{user.initials}}
            <!-- {{user.email}} -->
          </p>
          <md-tooltip>{{user.name}}</md-tooltip>
        </li>

      </div>
    </div>
    <!-- END SIDEBAR -->

在code为弹出框(HTML)驻留在文件dialog1.tmpl。此文件是相关的共享code在这个问题上的弹出框什么的只是布局

The code for the popup box (html) resides in the file dialog1.tmpl. This file is just the layout of the popup box nothing relevant to share the code in this question

下面是一个可视化我的用户列表,并弹出框 - > https://gyazo.com/694f65c5269cbca910ec6989ee5a77c2

Here is a visual of my user list and popup box -> https://gyazo.com/694f65c5269cbca910ec6989ee5a77c2

推荐答案

您没有访问用户在弹出窗口中,你的用户传递给弹出。

You don't access the user in the popup, you pass the user to the popup.

您已经发送用户ID,只是把整个用户。使用 user.name user._id 之后,你已经把它。

You are already sending the users id, just send the entire user. Use user.name and user._id after you've send it.

这篇关于如何访问用户名了NG-重复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆