I'm running into some issues with an angular directive. For some reason, the link function isn't working as expected.
It feels like there's a simple solution staring me in the face, but I just can't seem to pinpoint it.
Here's where the directive is needed:
angular.module('test').requires // ["injectedModule"]
You can find the code snippet on this Fiddle.
Any assistance would be greatly appreciated.
angular
.module('test', ['injectedModule'])
.controller('tester', [
function() {
this.test = function(data) {
alert(data);
}
}
]);
angular
.module('injectedModule', [])
.directive('testing', [
function() {
return {
restrict: 'E',
scope: true,
link: function(scope, element, attrs) {
alert(scope, element, attrs);
}
};
}
]);
<div ng-app="test">
<div ng-controller="tester as t">
<video id="test" ng-src="https://scontent.cdninstagram.com/hphotos-xfa1/t50.2886-16/11726387_1613973172221601_1804343601_n.mp4" testing="t.test(el)" />
</div>
</div>