2017-04-30 52 views
6

Bazı kaydırıcılara erişime ihtiyaç duyduğumdan, bir uygulamaya jQuery-UI eklemeye çalışıyorum. Birlikte jQuery için typings yüklediniz:TypeError: t.fx, jQuery-UI öğesini Angular 4 uygulamasına ekleme girişiminde bulunulmadığında undefined

npm install @types/jquery --save 

Ve index.html'ye jQuery ve jQuery UI CDN başvurular eklemiş

npm install @types/jqueryui --save 

ile jQuery UI typings olmak ne görünüyor

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> 

Ancak, Firefox'ta hatası alıyorum

Krom atar iken: Aynı hat At

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

. Angular 4 projesine jQuery-UI eklemek için bana doğru yöntemi söyleyebilir misiniz?

+0

ben bu kabul cevabı yapmak için hiçbir yolu var mı çok – holms

cevap

5

Jquery Slim, Jquery UI'nin temel aldığı bazı özellikleri kaldırır.

değiştirin ile

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

: iyi

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

cevap ihtiyacım? – Philippe