Set attribute value of angular directive from another controller

Viewed 10406

Angular directive;

.directive('ngFilemanager', function () {
        return {
                    restrict: 'EA',
                    scope: {
                        thefilter: '=',
                    },
                    link: function (scope, element, attrs) {
                    },
                    templateUrl: '/templates/filemanager.html',
                    controller: FileManagerController
        }

Html:

<div id="testcontainer" ng-controller="OtherController">
    ...
    <div ng-click="vm.myfunction">Set Filter</div> 
    ...
        <div id="thefilemanager" ng-filemanager thefilter=""></div>
    ...
</div>

How can i set thefilter value in a function of OtherController?

I tried setting the attribute value by jquery but my ng-view isn't updated correctly then.

2 Answers
Related