After added http to index.html, Again error message as first post ("EXCEPTION:
Cannot resolve all parameters for AppComponent(?). Make sure they all have
valid type or annotations. angular2.dev.js:25756")
May i ask what are you using version?
On Tuesday, December 15, 2015 at 12:26:07 PM UTC+5, adil mourahi wrote:
>
> Error 404 : (I see, you have to add "http" in your "index.html" , and you
> have to adjust the "friends.json" path :
>
> * 1/add "http" to your index.html : *
>
> <script src='......./angular2.dev.js'></script>
> <script src='......./ http.dev.js'></script>
>
>
>
>>
>> *2/ wwwroot->App->App.ts:*
>>
>>>
>>> .......
>>> export class AppComponent {
>>>
>>> result: Object;
>>> http: Http;
>>> constructor(http: Http) {
>>> this.result = { friends: [] };
>>> http.get('App/friends.json')
>>> .map((res:Response) => res.json())
>>> .subscribe(res => this.result = res);
>>> }
>>> }
>>> bootstrap(AppComponent);
>>>
>>
>> *wwwroot->App->friends.json:*
>> {
>> "friends": [ "Joe", "Tim", "Jim", "Jane" ]
>> }
>>
>>
>>
>>
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.