I'm just going through the Meteor Angular 2 Tutorial. At step 6 I randomly tried 'meteor update' which crashed my sample. Update worked and server is starting. However the browser screen stays now empty and in the console appears an error. Since I'm new to meteor I not able to figure out the reason why?
Reloading in browser ends up with the following error message in console:
Uncaught SyntaxError: Unexpected token <
Uncaught (in promise) Uncaught SyntaxError: Unexpected token <
Evaluating http://localhost:3000/client/app.js
Error loading http://localhost:3000/client/app.js
Update command console output:
meteor update
This project is already at Meteor 1.2.1, the latest release.
Changes to your project's package version selections from updating package
versions:
barbatus:angular2 upgraded from 0.6.6 to 0.7.3
barbatus:ng2-compilers upgraded from 0.1.0 to 0.1.1
barbatus:ts-compilers upgraded from 0.1.8 to 0.1.9_5
barbatus:typescript upgraded from 0.1.3 to 0.1.3_3
urigo:angular2-meteor upgraded from 0.2.5 to 0.3.5
Restarting meteor:
meteor
=> Started proxy.
=> Started MongoDB.
***** New typings have been added ***** |
typings/angular2/core.d.ts
typings/angular2/common.d.ts
typings/angular2/bootstrap.d.ts
typings/angular2/platform/browser.d.ts
typings/es6-promise/es6-promise.d.ts
typings/es6-shim/es6-shim.d.ts
***** Please re-start your app *****
meteor
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
Angular2 has changed and you'll need to import specific packages for each dependency. The Angular2 Meteor Tutorial is out of date. I'm not sure which packages should be imported to make Step 6 work, but as an example, Step 0 Bootstrapping would work with the following change:
In your app.ts change the line:
import {Component, View, bootstrap} from 'angular2/angular2';
to:
import {bootstrap} from 'angular2/platform/browser'
import {Component, View} from 'angular2/core';
Also, there are some updates for the tutorial here
Hope it helps.
UPDATE: I've found out that http://ng-meteor.meteor.com/tutorials/angular2/ is deprecated. I would recommend you to follow http://www.angular-meteor.com/tutorials/socially/angular2/ instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With