Estoy tratando de agregar jQuery-UI a una aplicación, ya que necesito acceder a algunos controles deslizantes. He instalado los tipos para jQuery con:
npm install @types/jquery --saveY lo que parecen ser los tipos jQuery-UI con
npm install @types/jqueryui --saveHe agregado las referencias CDN jQuery y jQuery-UI al index.html
<!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>Sin embargo, en Firefox me sale el error:
t.fx is undefined jquery-ui.min.js:6Mientras Chrome lanza:
cannot read property 'step' of undefined at <String>.anonymousEn la misma línea. ¿Alguien podría decirme el método correcto para agregar jQuery-UI a un proyecto Angular 4?
Jquery Slim elimina algunas funciones en las que se basa Jquery UI.
Reemplazar
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=" crossorigin="anonymous">Con:
<script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>