I'm feeling a bit lost as to why this isn't functioning properly...
Here's the directive I am working with:
app.directive('dateDropDowns', function () {
function link($scope, elem, attr) {
console.log($scope.startYear);
};
function controller($scope, $attrs, $location) {
};
return {
link: link,
scope: {
startYear: "&",
endYear: "&",
date: "=",
required: "&"
},
restrict: "EA",
templateUrl: "/scripts/templates/datedropdowns.html",
controller: controller
}
});
This is the html for my directive:
<div date-drop-downs start-year="startYear" end-year="endYear" required="true" date="testDate"></div>
The variables startYear
, endYear
, and testDate
are all defined in the controller's scope where the above html resides.
The console.log within the link function is displaying:
function (locals) {
return parentGet(scope, locals);
}
However, the expected value for startYear should be 1910 as specified in the controller of the "date-drop-downs" directive.
I have attempted
console.log($scope.$eval($scope.startYear));
but it yields the same result as above
I also gave
console.log($scope.$eval(attr.startYear));
a shot, but it resulted in the same outcome
Lastly, console.log(attr.startYear);
just returned the text "startMonth"
I'm uncertain on what steps to take next in order to retrieve the correct value for startYear.
Any assistance would be greatly valued.