Angular 6 Type Definition Not compiling

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Angular 6 Type Definition Not compiling



I am using Angular 6 and trying to call the mask function of the jquery.maskedinput javascript library in my ts file. The mask function in VS Code was not showing up or compiling so I found a type definition file and added it to the node_modules. Now intellitype finds the mask function and the squiggles go away. However I still get a compile error. What am I missing to have the page compile and use the mask function?



component.ts


/// <reference path="../../../../node_modules/@types/maskedinput/index.d.ts"/>
.....
$("#dob").mask("99/99/9999", placeholder: "mm/dd/yyyy" );



node_modules/@types/maskedinput/index.d.ts


interface JQuery
mask(mask: string, options?: JQueryMaskedInputOptions): JQuery;



I am not sure what I am missing at this point. Any guidance will help.



Thanks




1 Answer
1



I found the answer in another post with a similar issue here.



My issue was that I added the reference after my imports and not at the top of the page per documentation. Once I added the line below to the top of my component everything started working.


/// <reference path="../../../../node_modules/@types/maskedinput/index.d.ts"/>



Documentation -
Typescript Triple-Slash Directives






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

Trying to Print Gridster Items to PDF without overlapping contents

Mass disable jenkins jobs