Error in custom directive

Hi, I’m trying to use this custom directive to use VexFlow with angularjs/ionic:

But I’m getting the error:

0 265923 error Error: Vex.Flow.Artist is not a constructor

Any help ?

I resolved using this new directive