1

Most of the guides say that it is not a problem just download jquery and the typings file and then edit the typings file to remove the export $ part

The problem with that is that I need to export $ since the plugins I'm going to use expect jquery to be defined as $

How can I use jquery with angularjs2 with exporting the global $ jquery variable

kfir124
  • 1,286
  • 4
  • 14
  • 27
  • @WojciechKwiatek no its not good because they remove the '$' from the exports or I didn't understand it well and '$' will still refer to jquery? doesnt angularjs2 uses '$' for something else so we cant bind to it jquery? – kfir124 Jun 08 '16 at 17:29
  • The answer which is there is about deleting typings for that. You can still use jquery with a script tag or attach jquery imported from npm to window.$ – Wojciech Kwiatek Jun 08 '16 at 17:33
  • @WojciechKwiatek oh I see can you explain to me why did we need to remove the `$` from the typings? which module in angularjs2 uses that? and if I just include a – kfir124 Jun 08 '16 at 17:59
  • From the link: "tslint will give you an error since $ conflicts with protractor Subsequent variable declarations must have the same type. Variable '$' must be of type 'cssSelectorHelper', but here has type 'JQueryStatic'" Angular should not complain about global $ variable. – Wojciech Kwiatek Jun 08 '16 at 18:03

0 Answers0