angularjs - Is there a better way of doing 'element[0]' -


in link function of directives, i'm having element[0] select actual element. there more elegant way this?

for example, directive <canvas my-directive></canvas>.

var link = function (scope, element) {   var ctx = element[0].getcontext('2d');   // maybe element.first().getcontext('2d') instead? }; 


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -