AngularJS - Pass parameter to filter in custom directive -
i'm trying pass parameter (true, false) filter in custom directive, 'undefined'.
<job jobs="jobs" activatefilter="activatefilter">
in controller (outside of customdirective):
$scope.activatefilter = true;
this directive:
... restrict: 'e', scope: { jobs: "=jobs", activatefilter: "=activatefilter" }, controller: controller, templateurl: "/views/templates/job.html" ...
and template:
... data-ng-repeat="job in jobs | customfilter:activatefilter ...
any ideas i'm doing wrong? activatefilter undefined. thanks!!
try set attribute name lower case , dash-delimited:
<job jobs="jobs" activate-filter="activatefilter">
see this under normalization , isolating scope of directive
note: these =attr attributes in scope option of directives normalized directive names. bind attribute in div bind-to-this="thing", you'd specify binding of =bindtothis.
Comments
Post a Comment