实际上是从具有多个范围的注册表发送数据,即(veh_register、noofpass、avilableData、foundedClass)......
每个作用域对象都有如下数据 veh_register :{ "vin": vin89, "vplnum":AR 890S, "uni":proxu} noofpass:{noofpass:900} 可用数据:{“类”:9009,“名称”:manish} 等等……那样
然后如何将它们合并为单个作用域对象以通过 $http.Post 发送
这里是清晰的代码.........
AngularJs 中的 Controller 方法
$scope.vechicle_Register=function(veh_register,noofpass,avilableData, foundedClass,selectedOption1,selectedOption2){
**How to merge these veh_register+noofpass+avilableData+...........**
Into single Scope that send it from here to Target .........
$http.post("interface.php?action=sendVehRegDetails").then(function(result) {
$scope.year=result['data'];
});
}
最佳答案
你可以在 Angular 中使用 extend
函数:
https://docs.angularjs.org/api/ng/function/angular.extend
Extends the destination object dst by copying all of the properties from the src object(s) to dst. You can specify multiple src objects.
关于php - Angular : How to merge two or more scope into single scope,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24341348/