Discussion:
[AngularJS] Error TS2345 Argument of type '{ selector: string;
Theo
2015-11-25 22:40:40 UTC
Permalink
OS: Windows 10 Pro
IDE: Visual Studio 2015 (Community)

So, I'm attempting to run the '5 Minute Quickstart' angular 2 for
typescript demo, as documented at
https://angular.io/docs/ts/latest/quickstart.html, in Visual Studio and am
getting the following error message:

"Error TS2345 Argument of type '{ selector: string; template: string; }'
is not assignable to parameter of type '_ComponentArg'.
Object literal may only specify known properties, and 'template' does not
exist in type '_ComponentArg'. "

As can be seen in the right hand pane of the attached image, the Angular2
definition file is included in the project.

What is the issue here, and how do I resolve it?

Many thanks in advance,
Theo
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Eric Martinez
2015-11-26 00:39:07 UTC
Permalink
It looks like you are using an old version of angular2.

Did you run these commands?

1. npm init -y
2. npm i ***@2.0.0-alpha.44 ***@0.19.2 --save --save-exact
3. npm i typescript live-server --save-dev


Change alpha.44 to alpha.46 and the typings should work. Related to
typings, you probably should read this issue
https://github.com/angular/angular/issues/5248
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Theo
2015-11-26 12:42:39 UTC
Permalink
OS: Windows 10 Pro
IDE: Visual Studio 2015 Community
NPM version: 1.4.28

So, I run the following line:

"npm i ***@2.0.0-alpha.44 ***@0.19.2 --save --save-exact"

and a node_modules folder is created, in the root of my project, inside
which systemjs and angular2 are created. .

But then inexplicably the angular2 folder will suddenly disappear from the
node_modules folder! Any time the package.json file is amended in Visual
Studio, as shown in the attached image, the folder structure is recreated,
but then the angular2 folder disappears again

What is the issue here?

Many thanks in advance,
Theo
Post by Eric Martinez
It looks like you are using an old version of angular2.
Did you run these commands?
1. npm init -y
3. npm i typescript live-server --save-dev
Change alpha.44 to alpha.46 and the typings should work. Related to
typings, you probably should read this issue
https://github.com/angular/angular/issues/5248
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Theo
2015-11-27 15:10:29 UTC
Permalink
OS: Windows 10 Pro
IDE: Visual Studio 2015 Community
NPM version: 1.4.28

Further to the following post, and as shown in the attached image, npm i
***@2.0.0-alpha.44 fails completely.

What is the issue here?

Many thanks in advance,
Theo
Post by Theo
OS: Windows 10 Pro
IDE: Visual Studio 2015 Community
NPM version: 1.4.28
and a node_modules folder is created, in the root of my project, inside
which systemjs and angular2 are created. .
But then inexplicably the angular2 folder will suddenly disappear from the
node_modules folder! Any time the package.json file is amended in Visual
Studio, as shown in the attached image, the folder structure is recreated,
but then the angular2 folder disappears again
What is the issue here?
Many thanks in advance,
Theo
Post by Eric Martinez
It looks like you are using an old version of angular2.
Did you run these commands?
1. npm init -y
3. npm i typescript live-server --save-dev
Change alpha.44 to alpha.46 and the typings should work. Related to
typings, you probably should read this issue
https://github.com/angular/angular/issues/5248
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Eric Martinez
2015-11-27 16:04:04 UTC
Permalink
Those are really old versions of both node and npm

My current versions

- node v4.2.1
- npm v2.14.7

Those versions are the minimal recommended by the Developer guide
<https://github.com/angular/angular/blob/master/DEVELOPER.md>
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Loading...