angular.extend($scope.postConfig, $scope.channelConfig, {
scrollTop: 0
});
Is it correct way to extend 2 objects at once?
Yes, as mentioned in the angular.extend docs,
Extends the destination object dst by copying own enumerable properties from the src object(s) to dst. You can specify multiple src objects.
So, what you have in the question is correct syntax:
angular.extend($scope.postConfig, $scope.channelConfig, {
scrollTop: 0
});
Just make sure that first argument is the destination object which will get extended by the (multiple) source object(s) provided as next arguments.
As it said in AngularJS docs :
angular.extendExtends the destination object
dstby copying own enumerable properties from thesrcobject(s) todst. You CAN SPECIFY MULTIPLE SRC OBJECTS.
Usage: angular.extend(dst, src1, src2, ...);
Your syntax is correct.