Can we see an example using nested resources, I can't seem to figure out how that would work. I have a mongoose Schema like so:
varmongoose=require('mongoose');module.exports=functionSchemas(){this.schema=mongoose.Schema;this.EmployeeSchema=newthis.schema({'firstname': {type: String,required: true,trim: true},'lastname': {type: String,required: true,trim: true},'email': {type: String,required: true,trim: true,index: true,validate: /\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/},'departmentId': {type: this.schema.ObjectId,trim: true,required: true},'enddate': {type: String,trim: true},'active': {type: Boolean,"default": true}});this.EmployeeSchemaModel=mongoose.model('employees',this.EmployeeSchema);this.DepartmentSchema=newthis.schema({'name': {type: String,required: true,trim: true,index: {unique: true}},'employees': [this.EmployeeSchema]});this.DepartmentSchemaModel=mongoose.model('departments',this.DepartmentSchema);mongoose.connect('mongodb://localhost:8120/staff');};So I have Employee documents nested within Departments. How do I configure angular-bridge to give me URL's like:
/departments/{some department id}/employees/{some employee id}
Can we see an example using nested resources, I can't seem to figure out how that would work. I have a mongoose Schema like so:
So I have
Employeedocuments nested withinDepartments. How do I configure angular-bridge to give me URL's like:/departments/{some department id}/employees/{some employee id}