FIDDLE
I have created a directive :-
return {
restrict: \'EAC\',
scope: {
statesActive: \'=\'
},
inject $parse in your directive.... try this...
angular.module('myApp').directive('gtMap', ['$parse',
function($parse) {
return {
restrict: 'EAC',
link: function (scope, element, attrs) {
var fieldGetter = $parse(attrs.statesActive);
console.log(fieldGetter)
var field = fieldGetter(scope);
//var stateData = scope.statesActive.states;
// Don't get data here
console.log(field)
}
}
}
]);