Skip to content
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

how to import vendors ? #343

Open
phil123456 opened this issue May 30, 2017 · 1 comment
Open

how to import vendors ? #343

phil123456 opened this issue May 30, 2017 · 1 comment

Comments

@phil123456
Copy link

phil123456 commented May 30, 2017

Hi

I tried to move my "lodash" import to the vendor.ts but as expected,

the compilation gave errors

polyfills.js:7530 [at-loader] ./src/app/auth/auth.service.ts:56:25 
TS2686: '_' refers to a UMD global, but the current file is a module. Consider adding an import instead.

polyfills.js:7530 [at-loader] ./src/vendor.ts:14:13 
TS6133: '_' is declared but never used.

what am I missing ?

vendor.ts

// Angular 2
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/http';
import '@angular/router';

import 'rxjs';
import '@angularclass/hmr';

// Other vendors for example jQuery, Lodash or Bootstrap
// You can import js, ts, css, sass, ...
import * as _ from 'lodash';

thanks

@maxx0r
Copy link

maxx0r commented Jul 19, 2017

You should add the declaration in the auth.service.

there's no such thing as global variables as you're trying to use it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants