I'm new to Angular. I was trying to learn directives. In my directive's link
function I log my element and see that its an array. why it's an array?
<mouse-enter>HI</mouse-enter>
JS:
angular.module('custom.directive').directive('mouseEnter', function () {
return {
restrict: 'E',
link: function (scope, element) {
console.log(element);// this line prints an array!
element[0].onmouseover = function () {
console.log('Mouse Entered!');
};
}
}
});
In which case this array's length can be more than 1!!