mgechev/switching-to-angular2

'typings' references missing causing compile errors (ch4 ng-for app.ts code)

bofcarbon1 opened this issue · 8 comments

bofcarbon1:~/workspace/app/ch4/ts/ng-for/detailed-syntax (master) $ tsc app.ts --target es5
../../../../../node_modules/@angular/core/src/application_ref.d.ts(79,88): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/application_ref.d.ts(137,42): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/application_ref.d.ts(196,33): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(26,16): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/di/reflective_provider.d.ts(115,123): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/di/reflective_provider.d.ts(115,165): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/async.d.ts(34,33): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/async.d.ts(35,45): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(1,25): error TS2304: Cannot find name 'MapConstructor'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(2,25): error TS2304: Cannot find name 'SetConstructor'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(4,27): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(4,39): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(7,9): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(8,30): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(11,43): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(12,27): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(14,23): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(15,25): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(100,41): error TS2304: Cannot find name 'Set'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(101,22): error TS2304: Cannot find name 'Set'.
../../../../../node_modules/@angular/core/src/facade/collection.d.ts(102,25): error TS2304: Cannot find name 'Set'.
../../../../../node_modules/@angular/core/src/facade/lang.d.ts(11,17): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/lang.d.ts(12,17): error TS2304: Cannot find name 'Set'.
../../../../../node_modules/@angular/core/src/facade/lang.d.ts(68,59): error TS2304: Cannot find name 'Map'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(9,14): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(15,32): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(16,38): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(17,35): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(17,93): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(18,34): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(18,50): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(19,32): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(19,149): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/facade/promise.d.ts(20,43): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/compiler.d.ts(13,59): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/component_resolver.d.ts(9,58): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/component_resolver.d.ts(13,49): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(61,148): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(102,144): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(107,139): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/dynamic_component_loader.d.ts(108,135): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/systemjs_component_resolver.d.ts(18,53): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/core/src/linker/systemjs_component_resolver.d.ts(26,53): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/platform-browser-dynamic/index.d.ts(81,90): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/platform-browser-dynamic/index.d.ts(85,99): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/@angular/platform-browser-dynamic/index.d.ts(89,99): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/rxjs/Observable.d.ts(10,66): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/rxjs/Observable.d.ts(66,60): error TS2304: Cannot find name 'Promise'.
../../../../../node_modules/rxjs/Observable.d.ts(66,70): error TS2304: Cannot find name 'Promise'.
app.ts(8,7): error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option to remove this warning.

These examples are not aimed to be compiled with tsc in the way you did. You can perform the compilation and see the results by running npm start, as explained in the chapter.

For further details how to configure tsc you can take a look at the TypeScript docs.

OK

I'm probably going to be one of those 'challenging' students. :)

Brian

On Wed, Nov 2, 2016 at 6:41 PM, Minko Gechev notifications@github.com
wrote:

These examples are not aimed to be compiled with tsc in the way you did.
You can perform the compilation and see the results by running npm start,
as explained in the chapter.

For further details how to configure tsc you can take a look at the TypeScript
docs http://www.typescriptlang.org/docs/handbook/tsconfig-json.html.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJf1jkQUTq2Wb9ZJc3GUPvamVMNet8cvks5q6S2ngaJpZM4Kn53N
.

Awesome

npm install
npm start
... started with no errors

But no auto launch in browser probably because I'm in Cloud 9.
Which controls host URL and specific ports 8080, 8081... etc
So I was able to modify the config file and changed '5555' to '8081'.

Ended up with this URL

https://switchingtoangular2x-bofcarbon1.c9users.io:8081/dist/dev/

And that worked displaying the expected menu.

Thanks,

Brian

On Wed, Nov 2, 2016 at 8:23 PM, Brian Quinn bofcarbon1@gmail.com wrote:

OK

I'm probably going to be one of those 'challenging' students. :)

Brian

On Wed, Nov 2, 2016 at 6:41 PM, Minko Gechev notifications@github.com
wrote:

These examples are not aimed to be compiled with tsc in the way you did.
You can perform the compilation and see the results by running npm start,
as explained in the chapter.

For further details how to configure tsc you can take a look at the TypeScript
docs http://www.typescriptlang.org/docs/handbook/tsconfig-json.html.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJf1jkQUTq2Wb9ZJc3GUPvamVMNet8cvks5q6S2ngaJpZM4Kn53N
.

Can I recreate the angular seed that runs the menu via the npm start
without any external proprietary code of yours ? I wanted to separate out a
Web resume project run in a separate Cloud 9 workspace but reuse your
configuration and menu . This is the Angular2-seed .

On Nov 2, 2016 10:13 PM, "Brian Quinn" bofcarbon1@gmail.com wrote:

Awesome

npm install
npm start
... started with no errors

But no auto launch in browser probably because I'm in Cloud 9.
Which controls host URL and specific ports 8080, 8081... etc
So I was able to modify the config file and changed '5555' to '8081'.

Ended up with this URL

https://switchingtoangular2x-bofcarbon1.c9users.io:8081/dist/dev/

And that worked displaying the expected menu.

Thanks,

Brian

On Wed, Nov 2, 2016 at 8:23 PM, Brian Quinn bofcarbon1@gmail.com wrote:

OK

I'm probably going to be one of those 'challenging' students. :)

Brian

On Wed, Nov 2, 2016 at 6:41 PM, Minko Gechev notifications@github.com
wrote:

These examples are not aimed to be compiled with tsc in the way you
did. You can perform the compilation and see the results by running npm
start, as explained in the chapter.

For further details how to configure tsc you can take a look at the TypeScript
docs http://www.typescriptlang.org/docs/handbook/tsconfig-json.html.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJf1jkQUTq2Wb9ZJc3GUPvamVMNet8cvks5q6S2ngaJpZM4Kn53N
.

The version of the seed that this repository uses is kind of old already so I'd recommend you to take a look at https://github.com/mgechev/angular-seed.

This way you'll get all the tools required for bootstrapping a custom Angular 2 app.

Minko,

I'm having nothing but problems trying to add my own code.
Most of it is with TypeScript.
The compiler throws tons of errors.

bofcarbon1:~/workspace/app/ch9/webresume (master) $ tsc app.ts
../../../node_modules/@angular/core/src/application_ref.d.ts(79,88): error
TS2304: Cannot find name 'Promise'.
../../../node_modules/@angular/core/src/application_ref.d.ts(137,42): error
TS2304: Cannot find name 'Promise'.
../../../node_modules/@angular/core/src/application_ref.d.ts(196,33): error
TS2304: Cannot find name 'Promise'.
../../../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(24,15):
error TS2304: Cannot find name 'Map'.
../../../node_modules/@angular/core/src/change_detection/differs/default_keyvalue_differ.d.ts(26,16):
error TS2304: Cannot find name 'Map'.
../../../node_modules/@angular/core/src/di/reflective_provider.d.ts(115,123):
error TS2304: Cannot find name 'Map'.
../../../node_modules/@angular/core/src/di/reflective_provider.d.ts(115,165):
error TS2304: Cannot find name 'Map'.


I don't understand why we are coding in TypeScript then transpiling that to
JavaScript? What good is a script language that is not directly
executable?
All of the other script languages like JavaScript, JQuery and Ajax and many
more are. The Typescript code is loaded and flagged by the Google
Developer tool.
What is the point of having both the TypeScript and the JavaScript version
of the code? Shouldn't we just make the JavaScript app file available and
stick the TypeScript code somewhere else out of the way?

I am not coding any Angular2 right now. I'm spending all my time on Node.js,
Typescript and compiler errors. Why did you write an Angular2 book that
places a dependency on MEAN stack architecture?

I'm getting close to writing my Angular2 code with a .NET MVC, Web API
interface.
Brian

On Fri, Nov 4, 2016 at 3:15 PM, Minko Gechev notifications@github.com
wrote:

Yes, you can use https://github.com/mgechev/angular-seed. This way you'll
get all the tools required for bootstrapping a custom Angular 2 app.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJf1jlnkT7LrZSjyfIxOaFUF83Bj4pXlks5q66CCgaJpZM4Kn53N
.

As I mentioned above, this repository is not intended to be extensible. If you want to build your custom project use angular-seed.

I figured it out. Just coded over an old chapter.

On Nov 6, 2016 9:29 PM, "Minko Gechev" notifications@github.com wrote:

As I mentioned above, this repository is not intended to be extensible. If
you want to build your custom project use angular-seed
https://github.com/mgechev/angular-seed.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#21 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJf1joA1BwWoDSjL2fzPwNsWRB5Jv6Dyks5q7qkJgaJpZM4Kn53N
.