17 lines
431 B
JavaScript
17 lines
431 B
JavaScript
|
import {module} from '../module';
|
||
|
import {kebabToCamel} from '../lib/string';
|
||
|
|
||
|
/**
|
||
|
* Registers the element controller into its scope as a
|
||
|
* property whose name is the directive value.
|
||
|
*/
|
||
|
export function directive() {
|
||
|
return {
|
||
|
restrict: 'A',
|
||
|
link: function($scope, $element, $attrs) {
|
||
|
$scope[kebabToCamel($attrs.vnId)] = $element[0].$ctrl;
|
||
|
}
|
||
|
};
|
||
|
};
|
||
|
module.directive('vnId', directive);
|