I've run into a similar problem to Passing variable to directive template without creating new scope and this doesn't seem to help me. The code looks like;
.directive('billDir', function () {
return {
template: '<div><div draggable>hello {{msg}}</div></div>',
link: function (scope, elem, attrs) {
// scope.status = attrs.bill.getStatus();
scope.msg = "world!";
}
}
})
.directive('draggable', function ($document) {
return {
scope: {
bill: '='
},
replace: true,
restrict: 'A',
link: function (scope, element, attr) {
// do something here
var startX = 0,
startY = 0,
x = 0,
y = 0,
sourceX = 0,
sourceY = 0,
windowWidth = 0;
element.on('mousedown', function (event) {
event.preventDefault();
startX = event.pageX - x;
startY = event.pageY - y;
$document.on('mousemove', mousemove);
$document.on('mouseup', mouseup);
windowWidth = $(window).width();
sourceY = event.pageY;
sourceX = event.pageX;
}); // some more stuff, to the end of the directive
And billDir doesn't work as expected, I don't get anything in place of {{msg}}
What am I doing wrong here?