PatrickJS / NG6-starter

:ng: An AngularJS Starter repo for AngularJS + ES6 + Webpack
https://angularclass.github.io/NG6-starter
Apache License 2.0
1.91k stars 1.35k forks source link

How to include jquery-ui ? #171

Closed ramytamer closed 7 years ago

ramytamer commented 8 years ago

I want to include jquery-ui in my project.

I installed it via npm (npm install --save jquery-ui) it didn't work because of some error with the images, i found a solution to install this package (jquery-ui-bundle) it didn't work also as expected.

I don't know the best way to import or use package like jquery-ui with bunch of css & images (assets) files and import them via javascript.

Thanks

bmsdave commented 8 years ago

@ramytamer, show traceroute of exceptions

sabareeshkk commented 7 years ago

Try loading it using Webpack. expose-loader may help you

edin-m commented 7 years ago

Just import it...

import $ from 'jquery';
import '../../../node_modules/jquery-ui/ui/widgets/draggable';

Better:

import 'jquery-ui/ui/widgets/draggable';
fesor commented 7 years ago

@edin-m why not import 'jquery-ui/ui/widgets/draggable?

ramytamer commented 7 years ago

I ended up installing jquery-ui-bundle alongside with jquery of-course via npm and importing it like this:

import 'jquery';
import 'jquery-ui-bundle';