-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jquery and bootstrap not work #3202
Comments
I followed your exact steps but could not reproduce. Am running on OSX Are you sure jQuery is included? try |
UPDATE: Fixed updating to last angular-cli version. It happened to me with angular-cli: 1.0.0-beta.16. |
@lordmat0 yes, i'm sure jquery is included in script.bundle.js. |
Same issue for me ! OS?windows 10 x64 Versions.angular-cli: 1.0.0-beta.21 Repro steps.
{
"project": {
"version": "1.0.0-beta.21",
"name": "angular-todo"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"test": "test.ts",
"tsconfig": "tsconfig.json",
"prefix": "app",
"mobile": false,
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.min.js",
"../node_modules/tether/dist/js/tether.min.js",
"../node_modules/bootstrap/dist/js/bootstrap.min.js"
],
"environments": {
"source": "environments/environment.ts",
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"addons": [],
"packages": [],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"prefixInterfaces": false,
"inline": {
"style": false,
"template": false
},
"spec": {
"class": false,
"component": true,
"directive": true,
"module": false,
"pipe": true,
"service": true
}
}
} The log given by the failure.in Chrome
In scripts.bundle.js, jQuery is included : var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */ WorkaroundThe problem is that jQuery create the window.$ var, but not a window.jQuery var (which is expected by bootstrap). Same issue for Tether. The following workaround seems to work :
see #2760 Remaining issues after the workaround@types/jquery checkingThe @types/jquery/index.d.ts give the following tslint errors, and I didn't found how to ignore this file via tslint.json :
boostrap css importThe bootstrap's css isn't available in the app.component.js, even if it's included in styles.bundle.js and apparently correctly imported. angular-cli.json apps[0].styles is :
and if write this in styles.css, nothing ...
|
same issue with 1.0.0-beta.19-3 |
same issue with 1.0.0-beta.21 |
The problem seems to be resolved with beta.22-1 ! I replaced my previous workaround with the angular-cli.json scripts configuration shown in the README, and all seems to work fine now. I think we can close the issue. |
Closing thsi as fixed. Please note we have a Bootstrap 3 setup guide in work. |
Any timeline available or notification process for when Bootstrap 3 Setup guide completion. That will be a big help...thanks! |
Same issue on Beta 24 on node v7.4.0 on OS X 10.2.2. My angular-cli.json has been configured as
But I get errors when the page loaded, and neither jquery nor tether work. |
cnpm install xxx not work! use npm install solved! |
@xggaxlc Thank you! it works for my case, since we use cnpm You save my life! |
@xggaxlc why cnpm cannot work |
Try to install To translate jquery and bootstrap in typescript style. |
You have to turn off the service completly and turn on it again apparently the angular-cli.json is not update when you edit it |
Angular CLI: 1.6.5 thank you |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Repro steps.
The log given by the failure.
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: