Q:

Call modal window from factory method on ng-click

I Have a problem calling modal window from factory method on ng-click action.
I've tried 2 ways to call:
$scope.AddItem = function ($scope) {ModalWindowService.openAddItemDialog($scope)};

in this way, just nothing happens on click. but if i check with alert() it works.
$scope.AddItem = function () {alert('here');};

And if i do this: 
$scope.AddItem = ModalWindowService.openAddItemDialog($scope);

modal window opens just on page load, not as ng-click function.

So, how do i solve a problem?
This is the example code:
Main Controller:
    app.controller('MainController', ['$scope', 'ModalWindowService',  function($scope, ModalWindowService){
        //$scope.AddItem = ModalWindowService.openAddItemDialog($scope);
        $scope.AddItem = function ($scope) {ModalWindowService.openAddItemDialog($scope)};
    }]);

ModalWindowService:
app.factory('ModalWindowService',['$modal',function($modal) {
    function openAddItemDialog($scope) {

        $scope.animationsEnabled = true;
        $scope.valueToPass = "I must be passed";

        var modalInstance = $modal.open({
            animation: $scope.animationsEnabled,
            templateUrl: '/view/AddItemDialog.html',
            controller: 'AddItemController',
            resolve: {
                aValue: function () {
                    return $scope.valueToPass;
                }
            }
        });
        modalInstance.result.then(function (paramFromDialog) {
            $scope.paramFromDialog = paramFromDialog;
        });
    }

    return {
        openAddItemDialog: openAddItemDialog
    };
}]);

AddItemController:
app.controller('AddItemController',function($scope, $modalInstance, aValue) {
    $scope.valuePassed = aValue;
    $scope.close = function () {
        $modalInstance.close("Someone Closed Me");
    };
});

HTML from there the modal window should be opened:
            <button type="button" class="btn btn-orange btn-block" ng-click="AddItem()">
                Add
            </button>

A:

In your controller, don't pass $scope to $scope.AddItem function.
$scope.AddItem = function () {
    ModalWindowService.openAddItemDialog($scope)};
}]);

