2017-04-30 25 views
6

पर jQuery-UI जोड़ने का प्रयास करते समय t.fx अपरिभाषित है, मैं किसी एप्लिकेशन में jQuery-UI जोड़ने की कोशिश कर रहा हूं, क्योंकि मुझे कुछ स्लाइडर्स तक पहुंच की आवश्यकता है। मैं के साथ jQuery के लिए typings स्थापित किया है:TypeError: कोणीय 4 ऐप

npm install @types/jquery --save 

और क्या साथ

npm install @types/jqueryui --save 

मैं index.html पर jQuery और jQuery-यूआई CDN संदर्भ जोड़ लिया है jQuery-यूआई typings होने लगते हैं

t.fx is undefined  jquery-ui.min.js:6 
:

<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title>SimutronApp</title> 
    <base href="/"> 
    <script 
    src="https://code.jquery.com/jquery-3.2.1.slim.min.js" 
    integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" 
    crossorigin="anonymous"> 
    </script> 
    <script 
    src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" 
    integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" 
    crossorigin="anonymous"> 
    </script> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="icon" type="image/x-icon" href="favicon.ico"> 
</head> 
<body> 
    <app-root>Loading...</app-root> 
</body> 
</html> 

हालांकि, Firefox में मैं त्रुटि मिलती है 63,210

क्रोम फेंकता है जबकि:

cannot read property 'step' of undefined at <String>.anonymous 

एक ही पंक्ति पर। क्या कोई मुझे कोणीय 4 प्रोजेक्ट में jQuery-UI जोड़ने के लिए सही विधि बता सकता है?

+0

अच्छी तरह से मैं भी जवाब देने की जरूरत है – holms

उत्तर

5

Jquery Slim कुछ सुविधाओं को हटा देता है जो Jquery UI पर निर्भर करता है।

बदलें

<script 
    src="https://code.jquery.com/jquery-3.2.1.slim.min.js" 
    integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" 
    crossorigin="anonymous"> 
साथ

:

<script src="http://code.jquery.com/jquery-3.2.1.min.js" 
     integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" 
     crossorigin="anonymous"></script> 
+0

इस स्वीकार किए जाते हैं जवाब बनाने के लिए कोई रास्ता नहीं है? – Philippe