i have two controllers in my codes and in one there is an array.I want to use this array from other controller but it does not work.
I have simplified the codes to make them understandable.
My first controller;
app.controller('mycont1', ['$scope','$timeout', function($scope, $timeout) {
var my;
my=['1','something',.......];
}]);
My second controller in directive;
.....,controller: function($scope) {
var m=my[0];//i want to reach first controller array..
}
when i call it ,it could not find it.How can i use this array from other controller?