meteor - How to get phones from users collection -


i need phone numbers textarea users collection.how can do?

smsnumaralar=textarea

template.uyeleresmsgonder.events({     'click #numaralarikopyala': function (e, template) {      var getdata=meteor.users.find({});      template.$('#smsnumaralar').val(getdata.profile.phone);          }       }); 

you can extract array of phone numbers using map, join given separating character (a newline in example), , put newly created string of phone numbers in textarea:

template.uyeleresmsgonder.events({     'click #numaralarikopyala': function (e, template) {      var phonenumbers=meteor.users.find({}).map(function (user) {        return user.profile.phone;      }).join('\n');      template.$('#smsnumaralar').val(phonenumbers);     }  }); 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -