Did you remember to include the jquery.cookie
package in your code? Or just the
@types/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f892898d9d8a81d69b979dcfaf">[email protected]</a>
?
@types
are solely definition files for TypeScript, not the actual code itself. It's important to install the actual code:
npm install --save jquery.cookie
Next, ensure it is added to your packaging, particularly for SystemJS:
SystemJS.config({
'map': {
'jquery.cookie': 'npm:jquery.cookie'
},
'paths': {
'npm:': 'node_modules/'
}
});
To summarize:
@types
are definitions that enable TypeScript to understand JavaScript code/packages. These should not be imported directly into the code, but rather installed so that the TypeScript compiler can find them in node_modules/@types
.
- The package intended for use with TypeScript must still be installed using
npm
(or yarn
). This contains the actual code.