You're declaring an interface, not a global. Try this article: http://stackoverflow.com/questions/13252225/call-a-global-variable-inside-typescript-module
On Mon, Aug 22, 2016 at 12:51 PM Kameron Berget <[email protected]> wrote: > Thank you. I have created an interface and imported it as shown below. > Still getting errors. > > // pagecontextinfo.ts > > export interface _spPageContextInfo { > hasManageWebPermissions: boolean; > isAnonymousGuestUser: boolean; > isAppWeb: boolean; > isSiteAdmin: boolean; > layoutsUrl: string; > pageItemId: number, > pageListId: string; > pagePersonalizationScope: number; > ProfileUrl: string; > serverRequestPath: string; > siteAbsoluteUrl: string; > siteServerRelativeUrl: string; > systemUserKey: string; > userId: number; > userLoginName: string; > webAbsoluteUrl: string; > webServerRelativeUrl: string; > webTitle: string; > } > > import { _spPageContextInfo } from "../sharepoint/pagecontextinfo"; > > src/app/services/spdata.service.ts(21,24): error TS2304: Cannot find name > '_spPageContextInfo'. > > > > > On Sunday, August 21, 2016 at 9:16:54 PM UTC-5, Sander Elias wrote: >> >> Hi Kameron, >> >> Wrap it inside a service. If you are using typescript, you can create an >> interface >> <https://www.typescriptlang.org/docs/handbook/interfaces.html>for it, >> and use that wherever you need it. >> >> Regards >> Sander >> > -- > 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. > -- Lucas Lacroix Computer Scientist Advanced Technology Division, MEDITECH <http://ehr.meditech.com/> 781-774-2293 -- 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.
