admin管理员组文章数量:1026989
I'm trying to figure out how to use jQuery globally within my angular 2 app, the only reasonable source I found so far is this stackoverflow answer However I can't seem to get it working. Is there a way to achieve this with npm
package management instead of tsd (this mand is not working for me, I assumed it is ing from typescript, but seems like not).
After this, I think I need to reference jQuery within my app.ts file? (main file used by bootstrap.ts to boot the application)
Here is my project structure
app
ponents
app.ts
services
typings
bootstrap.ts
index.html
and few code examples I believe need to be used for jQuery implementation
app.ts
import {Component, View} from 'angular2/core';
@Component({
selector: 'app',
templateUrl: 'app/ponents/app.html'
})
export class App { }
bootstrap.ts
import {App} from './ponents/app';
bootstrap(App);
I'm trying to figure out how to use jQuery globally within my angular 2 app, the only reasonable source I found so far is this stackoverflow answer However I can't seem to get it working. Is there a way to achieve this with npm
package management instead of tsd (this mand is not working for me, I assumed it is ing from typescript, but seems like not).
After this, I think I need to reference jQuery within my app.ts file? (main file used by bootstrap.ts to boot the application)
Here is my project structure
app
ponents
app.ts
services
typings
bootstrap.ts
index.html
and few code examples I believe need to be used for jQuery implementation
app.ts
import {Component, View} from 'angular2/core';
@Component({
selector: 'app',
templateUrl: 'app/ponents/app.html'
})
export class App { }
bootstrap.ts
import {App} from './ponents/app';
bootstrap(App);
Share
Improve this question
edited Dec 14, 2017 at 15:36
Oleksii Pavlenko
1,3331 gold badge12 silver badges25 bronze badges
asked Jan 13, 2016 at 9:22
IljaIlja
46.6k103 gold badges289 silver badges528 bronze badges
1 Answer
Reset to default 5Install the jquery typings using:
npm install @types/jquery
Include the jQuery.js
file in your index.html
And.. that's it I guess :)
Good luck
I'm trying to figure out how to use jQuery globally within my angular 2 app, the only reasonable source I found so far is this stackoverflow answer However I can't seem to get it working. Is there a way to achieve this with npm
package management instead of tsd (this mand is not working for me, I assumed it is ing from typescript, but seems like not).
After this, I think I need to reference jQuery within my app.ts file? (main file used by bootstrap.ts to boot the application)
Here is my project structure
app
ponents
app.ts
services
typings
bootstrap.ts
index.html
and few code examples I believe need to be used for jQuery implementation
app.ts
import {Component, View} from 'angular2/core';
@Component({
selector: 'app',
templateUrl: 'app/ponents/app.html'
})
export class App { }
bootstrap.ts
import {App} from './ponents/app';
bootstrap(App);
I'm trying to figure out how to use jQuery globally within my angular 2 app, the only reasonable source I found so far is this stackoverflow answer However I can't seem to get it working. Is there a way to achieve this with npm
package management instead of tsd (this mand is not working for me, I assumed it is ing from typescript, but seems like not).
After this, I think I need to reference jQuery within my app.ts file? (main file used by bootstrap.ts to boot the application)
Here is my project structure
app
ponents
app.ts
services
typings
bootstrap.ts
index.html
and few code examples I believe need to be used for jQuery implementation
app.ts
import {Component, View} from 'angular2/core';
@Component({
selector: 'app',
templateUrl: 'app/ponents/app.html'
})
export class App { }
bootstrap.ts
import {App} from './ponents/app';
bootstrap(App);
Share
Improve this question
edited Dec 14, 2017 at 15:36
Oleksii Pavlenko
1,3331 gold badge12 silver badges25 bronze badges
asked Jan 13, 2016 at 9:22
IljaIlja
46.6k103 gold badges289 silver badges528 bronze badges
1 Answer
Reset to default 5Install the jquery typings using:
npm install @types/jquery
Include the jQuery.js
file in your index.html
And.. that's it I guess :)
Good luck
本文标签: javascriptusing jQuery globally within Angular 2 applicationStack Overflow
版权声明:本文标题:javascript - using jQuery globally within Angular 2 application - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745617756a2159393.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论