moizKachwala / Angular2-express-mongoose-gulp-node-typescript

AngularJS 2 (Updated to 4.2.0) Mean Stack application which uses Angular2, Gulp, Express, Node, MongoDB (Mongoose) with Repository Pattern Business Layer
MIT License
196 stars 86 forks source link

Unable to add Angular Material #41

Closed cliffeby closed 7 years ago

cliffeby commented 7 years ago

Followed https://material.angular.io/guide/getting-started and get Loading... Error reports are light Console: Error: (SystemJS) Unexpected token < SyntaxError: Unexpected token < at eval () at Object.eval (http://localhost:3000/app/app.module.js:13:18) at eval (http://localhost:3000/app/app.module.js:50:4) at eval (http://localhost:3000/app/app.module.js:51:3) Evaluating http://localhost:3000/@angular/material Evaluating http://localhost:3000/app/app.module.js Evaluating http://localhost:3000/app/main.js Error loading http://localhost:3000/app/main.js at eval () at Object.eval (http://localhost:3000/app/app.module.js:13:18) at eval (http://localhost:3000/app/app.module.js:50:4) at eval (http://localhost:3000/app/app.module.js:51:3) Evaluating http://localhost:3000/@angular/material Evaluating http://localhost:3000/app/app.module.js Evaluating http://localhost:3000/app/main.js Error loading http://localhost:3000/app/main.js (anonymous) @ (index):23 ZoneDelegate.invoke @ zone.js:391 Zone.run @ zone.js:141 (anonymous) @ zone.js:818 ZoneDelegate.invokeTask @ zone.js:424 Zone.runTask @ zone.js:191 drainMicroTaskQueue @ zone.js:584 ZoneTask.invoke @ zone.js:490

moizKachwala commented 7 years ago

did you register that in systemjs file ?

cliffeby commented 7 years ago

Yes. I included '@angular/material': 'npm:@angular/material/bundles/material.umd.js' to the var map object in systemjsconfig.js

moizKachwala commented 7 years ago

also you need to add the entry in gulpfile.ts

jankrib commented 7 years ago

I have the same issue. Which entry should be added to gulpfile.ts?

jankrib commented 7 years ago

For me it worked adding this:

  var ngPackageNames = [
    ...
    'material',
    'cdk',
    'animations'
  ];
moizKachwala commented 7 years ago

great 👍