typescript - Using FitVids JQuery Plugin in Anglular 2 Component -
i want use fitvids jquery plugin in angular 2 component. tried add fitvids function in jquery interface in jquery.d.ts file error. i'm using typescript. thank all!
i used jquery.d.ts file found on github. modified to:
[...] queue(queuename: string, callback: function): jquery; fitvids(selector?: any, opts?: any): jquery; } declare module "jquery" { export = $; } declare var jquery: jquerystatic; declare var fitvids: jquerystatic; the error is:
exception: exception: error during instantiation of articolo!. original exception: typeerror: jquery(...).fitvids not function
the issue having comes difference between compiletime , runtime
by adding fitvids .d.ts file correctly setting definition of method compiletime
however @ runtime application looking implementation of definition can't find one.
you need add .js file fitvids index.html page
<script src="path/to/fitvids.js"></script>
Comments
Post a Comment