angular2-meteor 样本在流星更新后停止工作
angular2-meteor sample stopped working after meteor update
我正在学习 Meteor Angular 2 教程。在第 6 步,我随机尝试了 'meteor update',这使我的样本崩溃了。更新有效,服务器正在启动。然而,浏览器屏幕现在保持空白,并且在控制台中出现错误。由于我是流星的新手,所以我无法弄清楚原因?
在浏览器中重新加载最终在控制台中出现以下错误消息:
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
更新命令控制台输出:
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
正在重启流星:
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 已更改,您需要为每个依赖项导入特定的包。 Angular2 Meteor 教程已过时。我不确定应该导入哪些包才能使第 6 步正常工作,但作为示例,第 0 步引导 将适用于以下更改:
在您的 app.ts 中更改行:
import {Component, View, bootstrap} from 'angular2/angular2';
至:
import {bootstrap} from 'angular2/platform/browser'
import {Component, View} from 'angular2/core';
另外,教程有一些更新here
希望对您有所帮助。
更新:
我发现 http://ng-meteor.meteor.com/tutorials/angular2/ is deprecated. I would recommend you to follow http://www.angular-meteor.com/tutorials/socially/angular2/ 相反。
我正在学习 Meteor Angular 2 教程。在第 6 步,我随机尝试了 'meteor update',这使我的样本崩溃了。更新有效,服务器正在启动。然而,浏览器屏幕现在保持空白,并且在控制台中出现错误。由于我是流星的新手,所以我无法弄清楚原因?
在浏览器中重新加载最终在控制台中出现以下错误消息:
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
更新命令控制台输出:
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
正在重启流星:
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 已更改,您需要为每个依赖项导入特定的包。 Angular2 Meteor 教程已过时。我不确定应该导入哪些包才能使第 6 步正常工作,但作为示例,第 0 步引导 将适用于以下更改:
在您的 app.ts 中更改行:
import {Component, View, bootstrap} from 'angular2/angular2';
至:
import {bootstrap} from 'angular2/platform/browser'
import {Component, View} from 'angular2/core';
另外,教程有一些更新here
希望对您有所帮助。
更新: 我发现 http://ng-meteor.meteor.com/tutorials/angular2/ is deprecated. I would recommend you to follow http://www.angular-meteor.com/tutorials/socially/angular2/ 相反。