**Payment.js**var PaymentSchema = new Schema({   
    customer: {
       customerRef: {
            type: Schema.ObjectId,
            ref: 'Customer'
        },
        custMemberId : String,
        branch : String
       },
        paymentStatus : String,
        payBalance : Number,
        deliveryMode : String});
**Order.js**var OrderSchema = new Schema({
  OrderId : string,
  products :[{type : String}],
  totalCost : Number});
**Customer.js**var Customer= new Schema({Name : String,
previousOrders :[{
      type: Schema.ObjectId,
            ref: 'Order']}
});

I have noted down some of the fields in the schema files. My problem is 
from a payment page,

If I refer to the previous orders of customer, I am not able to access the 
array previousOrders.

I try

console.log($scope.payment.customer.customerRef.previousOrders);

the output is 'undefined'

Please let me know , the other possibilities.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to