php - Angular : How to merge two or more scope into single scope

标签 php angularjs angularjs-directive angularjs-scope angularjs-ng-repeat

实际上是从具有多个范围的注册表发送数据,即(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/

相关文章:

html - 什么元素在中心?

javascript - 测试 Angular Controller 定义如 angular.module ('myApp' ).controller(

javascript - 动态添加 Angular 指令

angularjs - 在我点击一堆之后,AngularStrap TypeAhead 就可以工作了

php - 在 Eloquent 模型上调用 chunk 时,/bootstrap/cache/compiled.php 中出现 BadMethodCallException

javascript - AngularJS 和 PHP : upload my app on several servers after changes

javascript - 当我选中复选框时如何将值 text1 复制到 text2?

javascript - Angular JS - 替换 ng-options 中的空值

php - 递归php函数问题: works without any result

php - 使用 regex 或 php 函数获取 ":"(冒号)之前的所有字符