[AngularJS] Re: How to inject a service in Angular2

2015-07-29 Thread Eric Martinez
Hey there Pete! 'appInjector' was removed in alpha 30 (see https://github.com/angular/angular/pull/2797) You should use 'viewInjector' instead if it is a component and 'hostInjector' if it is a directive. Regards. -- You received this message because you are subscribed to the Google Groups

[AngularJS] Re: How to inject a service in Angular2

2015-07-29 Thread Eric Martinez
It was removed in alpha 29 (https://github.com/angular/angular/blob/master/CHANGELOG.md), just rectifying my mistake. El miércoles, 29 de julio de 2015, 23:18:23 (UTC-3), Eric Martinez escribió: > > Hey there Pete! > > 'appInjector' was removed in alpha 30 (see > https://github.com/angular/ang

[AngularJS] Re: How to inject a service in Angular2

2015-07-30 Thread Pete Moss
Thank you, Eric. I tried appInjector, viewInjector, componentServices, and hostInjector and nothing worked. I spent hours yesterday trying to puzzle it out. Then I discovered that I had not included --emitDecoratorMetadata in my Typescript 1.5 compiler settings. Aaargh. Once I did that, things

[AngularJS] Re: How to inject a service in Angular2

2015-08-20 Thread Magnus Gudmundsson
Hi, I also struggling with this one. my Typescript cmd for sublime goes like this: "cmd": ["tsc.cmd", "$file", "--watch", "-m","commonjs", "-t", "es5", "--emitDecoratorMetadata", "--experimentalDecorators"], but it does no work. Pete, which of the Injectors did you end up using? Regards M

[AngularJS] Re: How to inject a service in Angular2

2015-08-20 Thread Magnus Gudmundsson
I got it to work! I had just forgotten about adding the FriendsService to the botstrap thingy... sorry about the noise. /Magnus Den torsdag 20 augusti 2015 kl. 10:35:51 UTC+2 skrev Magnus Gudmundsson: > > Hi, > > I also struggling with this one. > my Typescript cmd for sublime goes like this

[AngularJS] Re: How to inject a service in Angular2

2015-08-23 Thread Tahir Awan
Hi, I too, can't find how to inject Http (or $http?) service. Some examples mentioned adding an import of "angular2/di.d.ts" but I could not find it with "tsd" or in definitely-typed repo. Please help. Thanks. On Thursday, July 30, 2015 at 12:21:48 AM UTC+3, Pete Moss wrote: > > I am using Ang

[AngularJS] Re: How to inject a service in Angular2

2015-08-23 Thread Pete Moss
The way I injected the Http service is by adding viewInjector: [httpInjectables] in my top-level root component that is created using bootstrap(). EG, import {Component, View, bootstrap, httpInjectables} from "angular2/angular2"; @Component({ selector: "litebrite-app", // Pre-register ap

[AngularJS] Re: How to inject a service in Angular2

2015-08-24 Thread Tahir Awan
tried but no luck. tsc compiler error "error TS2305: Module '"angular2/angular2"' has no exported member 'httpInjectables'.". I am now using npm to get angularjs but perhaps its a moving target. On Sunday, August 23, 2015 at 6:58:41 PM UTC+3, Pete Moss wrote: > > The way I injected the Http serv

[AngularJS] Re: How to inject a service in Angular2

2015-08-24 Thread Eric Martinez
Tahir, If you are using npm to get the js bundles, I'm guessing you are using alpha35. If that's the case you should export 'HTTP_BINDINGS' from 'http/http' and include http.dev.js in your HTML, Kind regards. -- You received this message because you are subscribed to the Google Groups "Angul

[AngularJS] Re: How to inject a service in Angular2

2015-08-25 Thread Tahir Awan
Eric, I did that and to resolve this import, I added the following typing reference in gulpfile.js. "node_modules/angular2/bundles/typings/angular2/http.d.ts" but still TypeScript compiler is giving errors like "can't find name EventEmitter". Regards, On Monday, August 24, 2015 at 7:57:46 PM

[AngularJS] Re: How to inject a service in Angular2

2015-08-25 Thread Eric Martinez
Tahir, I don't think you should modify that file, I mean, it has nothing to do with the typings and it is used to run the tests. EventEmitter should be imported from 'angular2/angular2'. I recommend you to open a new thread, so we can see your problem better and you can specify what are you

[AngularJS] Re: How to inject a service in Angular2

2015-08-25 Thread Tahir Awan
Eric, good suggestion. I've started a new thread under "Importing http in an Angular2 + TypeScript project" On Tuesday, August 25, 2015 at 5:56:20 PM UTC+3, Eric Martinez wrote: > > Tahir, > > I don't think you should modify that file, I mean, it has nothing to do > with the typings and it is u