Get value from directive to $scope in controller
问题 In my Directive, I've getting some data from my backend like this: var monster_info = angular.element(this).find("img").attr("title"); $http.get("lib/terrain.php", {params: { monster_data:monster_info}}).success(function(data) { console.log(data); }); I want this data to appear at my site, so I've tried to declare a variable like this in my controller: $scope.fish = []; Then I just assign the data value like this in my directive: $scope.fish = data; But nothing is printed out. How does the