I need to create a directive that acts upon table cells where the table rows are rendered using ng-repeat
-- to that end I have relied in part on this answer to a question entitled "Calling a function when ng-repeat has finished". Unlike that Q&A however, I need to pass in an argument to my directive, and for this I have relied in part on this answer (to a question entitled "Angularjs - Pass argument to directive").
So in my case I've added fixed-column-tooltip
for my directive, and columnselector
as its argument to the <tr>
as follows:
<tr fixed-column-tooltip columnselector=".td-keyField" ng-repeat="trData in trDataWatch">
But when per the second answer, I added what I've learned is an "isolate scope" to my directive, I no longer had access to the original scope necessary as per the first answer:
'use strict';
angular.module('cmt.cases.directives')
.directive('fixedColumnTooltip', function ($timeout) {
return {
restrict: 'A',
scope: {
columnselector: '@'
},
link: function (scope, element, attr) {
if (scope.$last === true) { //undefined because not operating on original scope
...
Is there a way to maintain access to the original scope, but also have access to the columnselector
argument?