using external JS libraries in my angular 2 project

If you use angular-cli, you can add all your external JS files in assets folder. And then in angular-cli.json add them: “scripts”: [ “../node_modules/jquery/dist/jquery.min.js”, “../node_modules/bootstrap/dist/js/bootstrap.min.js”, “../node_modules/moment/moment.js”, “../node_modules/chart.js/dist/Chart.bundle.min.js”, “../node_modules/chart.js/dist/Chart.min.js”, “../node_modules/ng2-datetime/src/vendor/bootstrap-datepicker/bootstrap-datepicker.min.js”, “./assets/js/slimscroll.min.js”, “./assets/js/inspinia.js”, “./assets/js/metisMenu.js”, “./assets/js/footable.all.min.js” ] You can do it also with external styles: “styles”: [ “../node_modules/ng2-toastr/bundles/ng2-toastr.min.css”, “../node_modules/bootstrap-sass/assets/stylesheets/_bootstrap.scss”, “../node_modules/font-awesome/scss/font-awesome.scss”, “../node_modules/ng2-datetime/src/vendor/bootstrap-datepicker/bootstrap-datepicker3.min.css”, “./assets/scss/plugins/footable/footable.core.css”, “./assets/scss/style.scss” ] And of course you … Read more

how to use underscore.js library in angular 2

For a project based on https://cli.angular.io, I needed to do the following: 1) Import libraries npm install underscore –save npm install @types/underscore –save 2) in tsconfig.app.json, add underscore to array ‘types’: “types”: [ “underscore” ] 3) In any component file I need to use underscore, I add this import * as _ from ‘underscore’; 4) … Read more

Apollo is not assignable to parameter of type ‘VueClass

The syntax for the “apollo” options you listed do indeed look correct- assuming you’re intending to use the package “vue-apollo” to work with Apollo. If you’re getting this error it may mean that “vue-apollo” hasn’t been installed, or there’s some problem with the installation. If you look in the Vue Chrome debugger tool on one … Read more