I want to be able to use the variable "videoUrlId" from the controller 'useSpreadsheetData' below in my directive 'meetings'. How can I do this? I have looked at require but could not get it to work.
Controller:
app.controller('useSpreadsheetData', ['$scope', '$sce', 'getSpreadsheetData',
function($scope, $sce, getSpreadsheetData){
for(var x in videos) {
if(videos[x].switchValue) {
var videoUrlId = videos[x].videoUrl;
$scope.videoUrlId = videoUrlId;
break;
}
}
};
Directive:
app.directive('meetings', [ 'getCalendar', '$timeout', '$window',
function(getCalendar, $timeout, $window){
return {
restrict: 'E',
templateUrl: 'scripts/directives/meetings.html',
controller: 'useSpreadsheetData',
link: function(scope){
//Use videoUrlId variable here
}
}
}]);