Thursday, 13 April 2017

Is there a way to ref a data type in typescript while declaring an angular2 data model

In Mongoose, it has a way to refer to another data definition. I wonder if there is a way we can do while we are defining a data module for angular2?

In Mongoose

var personSchema = Schema({
  _id     : Number,
  name    : String,
  age     : Number,
  stories : [{ type: Schema.Types.ObjectId, ref: 'Story' }]
});

My question:

export class Person {
  _id     : number;
  name    : String;
  age     : Number;
  stories : [
      //sometype
  ]
}



via Mathers

No comments:

Post a Comment