so I have this custom directives that you could see below.
myApp.directive('myDirective', function () {
return {
restrict:'EA',
link:function (scope, element, attr) {
//defined the object
var object = new object();
}
}
});
myApp.directive('mySecondDirective', function () {
return {
restrict:'EA',
link:function (scope, element, attr) {
//call the variable from previous custom directive
console.log(object);
}
}
});
and this is the html structure where I used the directives above.
<my-directive></my-directive>
<my-second-directive></my-second-directive>
there I want to retreive the object
that contains new object()
from previous custom directive, but it always return an undefined
I wonder how could I do this without using require nor isolated scope as well.. could you guys help me ?