Closed sabas closed 8 years ago
The solution is to change the import to
import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
http://stackoverflow.com/questions/34697466/cannot-find-module-angular2-angular2
Also the first row (/// <reference) is not needed?
Then I got a bunch of Duplicate identifier errors, which I fixed changing in tsconfig.json the target from es2015 to es5
Yes, we are well aware of that: Unfortunately the code currently available in the PDF chapter still refers to Alpha 37 or so, which is a billion versions back in regars of the current beta.1. Remember that the chapters supplied in the alpha book have not gone through technical review and proper proofreading yet (hence the "alpha" label) so bugs and inaccuracies are still common in this early versions.
In a few days or weeks time you guys will receive updated versions of the first chapters, reflecting the latest incarnation of the framework API. In the meantime, please refer to the code examples in this repository, which happen to be fully in sync with the current state of Angular 2.
Thanks for the catch regarding the missing comma! :)
And now for the issues reported:
app.ts(1,1): error TS6053: File 'node_modules/angular2/angular2.d.ts' not found.
In the beginning we were forceed to rely on the type definitions to ensure proper compilation. That is no longer needed. So you can safely remove the /// <reference...
from your code.
app.ts(2,38): error TS2307: Cannot find module 'angular2/angular2'.
As you discovered yourself already, this token was substituted by angular/core
as for Alpha 53. Two versions later the framework transitioned into Beta stage.
Please refer to the code in this very same repo for further reference. Chapter 1 is alrady available and dully in sync with Beta.1. The code for the next chapters will go live in the forthcoming days.
Thanks a lot!
You're welcome Stefano. Keep an eye on this repo for the most updated version of the code examples. Updated code examples pertaining to chapters 3 and 4 will hit the repo shortly.
I believe these are due to the beta changing from beta0 to beta1.
Page 7 there's a typo (missing a comma) in
so the output is
app.ts(6,2): error TS1005: ',' expected.
When fixed the error becomes