Skip to content

Instantly share code, notes, and snippets.

@tiandiduwuxiaoxiao
Last active January 17, 2018 10:22
Show Gist options
  • Save tiandiduwuxiaoxiao/954a5fb9b1b79ccb69225e5e2612a336 to your computer and use it in GitHub Desktop.
Save tiandiduwuxiaoxiao/954a5fb9b1b79ccb69225e5e2612a336 to your computer and use it in GitHub Desktop.
install jquery in angular cli project

Install Jquery

  • Notice:check the version of jquery via below command:
    npm view jquery dist-tags
    
  1. install jquery via npm with below a few steps:
  • First: Install jQuery, the actual library

    npm install jquery --save
    
  • Second: Install jQuery TypeScript autocomplete

    npm install @types/jquery --save-dev
    
  • Finally: Go to the ./angular-cli.json file at the root of your Angular CLI project folder, and find the scripts: [] property, add this inside it:

    "../node_modules/jquery/dist/jquery.min.js"
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment