Hi Jordy,
How are you delivering your stream to the browser?
This should be done in a service, and your directive can $watch this service,
or you service can notify subscribers.
BTW, a isolated scope with a value ‘=’ should not receive an {{value}} expresion from your template, but
a scope or controller property like my-attribute="propertyName" in your HTML/template
Regards
Sander
angular.module('TEST').directive('helloWorld', function() { return { restrict: 'AEC', replace: 'true', template: '<p ng-click="select()">Hello World!! {{streamData}}</p>',
link: function (scope, element, attrs) { scope.streamData = scope.$parent.models[scope.rowIndex].StreamData; scope.$watch(attrs.streamData, function(items) {
}); } }; });$scope.onMouseEnter = function ($event, index) { $scope.rowIndex = index; var coords = getMouseEventResult($event, "Mouse move");
var newElement = $compile('<div id="screenshot"> <hello-world name="row.StreamData" rowIndex="$scope.rowIndex" /></div>')($scope); angular.element(document.body).append(newElement); $("#screenshot") .css("top", (coords.y - xOffset) + "px") .css("left", (coords.x + yOffset) + "px") .fadeIn("fast"); };$scope.$broadcast('streamData', ......);
scope.$on('streamData', function (event, args) { scope.streamData = args.streamData });