angular.module('app', [])
.controller('aCtrl', function() {
this.count = 0;
})
<ul ng-controller='aCtrl as ctrl' >
<li data-ng-repeat="item in [23,4,5,6,7] | filter:search">
<span ng-init='ctrl.count = ctrl.count + 1'>{{item.name}}</span>
</li>
</ul>
app.directive("name", function () {
controller : function ($scope) {
var self = this;
$scope.toThis = function (name , data ) {
self[name] = data
}
},
link:function(scope,elem,attr,contr){
scope.toThis("slide", elem)
}
}
app.directive("name2", function () {
require : "name",
controller : function () {
//this
},
link:function(scope,elem,attr,contr){
contr.slide
}
}