c# - angularjs Pass data has list data -


i want pass data has list of child here

{  id : 1,  title : 'test',  childs : [     { id : 1, name: 'name1' },     { id : 2, name: 'name2' },     { id : 3, name: 'name3' }] } 

i want pass web api controller

public ihttpactionresult post(batche model){      return model; } 

and batch

 public class batche  {      public long id { get; set; }      public string title{ get; set; }      public icollection<batchdetail.batchdetail> batchdetails { get; set; }  } 

and batch details

public class batchdetails(){       public long id { get; set; }       public string name{ get; set; } } 

when post data me null

$http({    method : 'post',    url : baseurl + "api/mycontroller",    data : $scope.model }) 

use [frombody] before method parameter

public ihttpactionresult post([frombody]batche model){ 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -