You can try entering $controller and last as follows:
app.directive('myUiDirective', function ($controller) { return { link: function (scope, iElem, iAttr) { angular.extend(this, $controller('UibDatepickerController', {$scope: scope})); } });
However, I'm not sure if you can get the controller from another module (in this case, from ui.bootstrap ).
source share