I'm post example, because i'm thinking you are easier understand my question.
I have this HTML markup
<div ng-app="autoDrops" ng-controller="testController as test">
<div ng-controller="simpleController as simple">
<a href="" ng-click="test.addValue(value, test.testValue)">Add</a>
<a href="" ng-click="test.addValue2(value2, test.testValue2)">Add2</a>
</div>
<a href="" ng-click="test.addValue(value, test.testValue)">Add</a>
<a href="" ng-click="test.addValue2(value2, test.testValue2)">Add2</a>
<p>
{{test.testValue}}
</p>
<p>
{{test.testValue2}}
</p>
<div>
and my AngularJs controllers defined like this
var autoDrops = angular.module('autoDrops', []);
autoDrops.controller('testController', function ($scope) {
this.testValue = 0;
$scope.value = 1;
this.addValue = function(value, testValue){
//why function not work, if i remove this?
testValue = testValue + value;
}
$scope.value2 = {value:"1"};
this.testValue2 = [];
this.addValue2 = function(value, testValue2){
//this function work with this?
testValue2.push(value);
}
});
autoDrops.controller('simpleController', function ($scope) {
$scope.value = 1;
$scope.value2 = {value:"1"};
});
Example you can see jsfiddle