Pass callback function to directive

后端 未结 4 890
失恋的感觉
失恋的感觉 2020-12-09 04:00

I\'m trying to pass a callback function from a controller to a directive.

Here\'s the callback function code:

$scope.onImageSelect = function(image)          


        
4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 04:41

    try to change the scope object to be like this

    scope: {
            callback: '='
        }
    

    and it will work

提交回复
热议问题