hi,

need a little help with injecting constants in Angular2:

/*models.ts*/
import {Injectable,bind,Inject} from 'angular2/core';
 
export var TEST_API_URL: string = 
'https://www.googleapis.com/youtube/v3/search';
 
    export var testServiceInjectables: Array<any> = [
        bind(TEST_API_URL).toValue(TEST_API_URL)
    ];
 
/*boot.ts*/
 
import {testServiceInjectables} from './services/models';
bootstrap(loginForm, [HTTP_PROVIDERS, youTubeServiceInjectables]);
 
/*app.ts*/
 
import {Injectable, bind, Component, Inject} from 'angular2/core';
 
export class test{
constructor(public http: Http,
        @Inject(TEST_API_KEY) private apiKey: string
        ){
    }
}

But getting all the time Cannot find name 'YOUTUBE_API_KEY'".

I doing like tutorial in ng-book2 but i do not know what I am missing.
tnx
miha

-- 
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.

Reply via email to