2017-08-04 1 views
1

私は、ang4プロジェクトにカスタマイズされたjqueryUI datepickerコンポーネントを追加しようとしています。現在、通常のjquery、html、cssで開発しています。そのコンポーネントをangular4に追加したいと思います。 私は以下のように試しましたが、npm startを実行するとエラーが発生します。jQueryUI with angular4

(rangepickerにカスタマイズされた)私のjqueryのUIの日付ピッカー

enter image description here

はこれ]私はjqueryUIが

"apps": [ 
{ 
    "root": "src", 
    "outDir": "dist", 
    "assets": [ 
    "assets", 
    "favicon.ico" 
    ], 
    "index": "index.html", 
    "main": "main.ts", 
    "polyfills": "polyfills.ts", 
    "test": "test.ts", 
    "tsconfig": "tsconfig.app.json", 
    "testTsconfig": "tsconfig.spec.json", 
    "prefix": "app", 
    "styles": [ 
    "styles.css", 
    "../node_modules/jquery-ui/../themes/base/all.css", 
    "../node_modules/bootstrap/dist/css/bootstrap.min.css" 
    ], 
    "scripts": ["../node_modules/jquery/dist/jquery.min.js", 
    "../node_modules/jqueryui/jquery-ui.js", 
    "../node_modules/bootstrap/dist/js/bootstrap.min.js"], 
    "environmentSource": "environments/environment.ts", 
    "environments": { 
    "dev": "environments/environment.ts", 
    "prod": "environments/environment.prod.ts" 
    } 
} 

をangular4するインポートする方法です、

これは私が取得エラーですコマンドプロンプト

enter image description here

答えて

5
"scripts": ["node_modules/jquery/dist/jquery.min.js","node_modules/jqueryui/jquery-ui.js", 
"node_modules/bootstrap/dist/js/bootstrap.min.js"] 

フルパスを与えることによって動作していない場合は、これを試してみてください。

npm uninstall -g angular-cli @angular/cli 
npm cache clean 
npm install -g [email protected] 

"styles": [ 
    "fullpath/styles.css", 
    "node_modules/jquery-ui/../themes/base/all.css", 
    "node_modules/bootstrap/dist/css/bootstrap.min.css" 
], 
+0

それは同じようにjquiery.min.jsが、jquery.min.css doesntのインポートのために働いていました。同じエラーが発生します。 CSSをインポートする方法はありますか? – Lahi2010

+0

私は答えを更新し、CSSへのフルパスを与えることを試みる。 –

関連する問題