Javascript/Angular - JS对象的属性和方法

Javascript/Angular - Properties and methods of JS Object

JavaScript 对象是称为属性或方法的命名值的容器,但我想知道当我将某个对象发送到 Angular 的 $http.post 时,它是否识别只有属性?

参考:https://www.w3schools.com/js/js_objects.asp 我的意思的例子:

//测试工厂

return function(){
        {name: 'test1', getName :  function(){ return this.name }
       };

//测试控制器

vm.Test = new TestFactory();
TestService.Save(vm.Test);

//测试服务

function Save(testdata){
 $http.post('url/test/save', testdata)
}

要查看 post 负载是什么,您可以

console.log( JSON.stringify( test_data ) );

你会看到这样的东西

{
  'name': 'test1',
  'getName': '[Function]'
}