Show data with Mongoose and NodeJS

1

I just started with this backend and I have some doubts.

I have a Schema in Mongoose :

const mongoose = require('./model'),
    Schema = mongoose.Schema,
    TeamSchema = new Schema({
        _id       : Schema.Types.ObjectId,
        name  : String,
        last  : String,
        table : String,
        entr  : Number,
    },
    {
        collection : 'team'
    }),
    Team = mongoose.model('Team', TeamSchema);

module.exports = Team;

I already have the CRUD part and the login, and I can show the data I have in my database.

This is the view:

//- Contenido Central
    div.centralCont
      div.centralCont-wrapper
        div.centralCont-column
          h2.centralCont--titulo INVITADOS
          div.centralCont--list
            each contacto in data
              div.centralCont-invitado
                div.centralCont-contNombre
                  div.centralCont-nombres
                    div.centralCont-nombre
                      h3.centrarCont--invtNombre #{contacto.name}
                    div.coentralCont-last
                      h3.centrarCont--invtNombre #{contacto.last}
                  div.central-cont-mesa
                    p.central-cont__text MESA
                    p.central-cont--mesa #{contacto.table}
                  div.central-cont-mesa
                    p.central-cont__text INVI
                    p.central-cont--mesa #{contacto.entr}

        div.centralCont-column(ng-controller="StoreController as store")
          h2.centralCont--titulo INFORMACIÓN DE LA MESA
          div.centralCont-invitado
            div
              each contacto in data
                p.centralCont-invitado__text #{contacto.name}

I just need to interact with that information. What if I click on ...

h3.centrarCont--invtNombre #{contacto.name}

... in the following div :

div.centralCont-invitado
   div
     each contacto in data
       p.centralCont-invitado__text #{contacto.name}

The names are shown, only from that table, and if I click on another name of another table, the names are hidden, and those of the new table are displayed.

    
asked by dallana karina 10.11.2016 в 02:18
source

0 answers