So I'm in the process of developing a module with sub-modules for Angular. Here's the notation I'm using:
module App.services {
export class SomeService { }
}
When initializing all services, I use the following code snippet:
function defToArray(def: any): any[] {
return (def.dependencies || []).concat(def)
}
for (var s in App.services)
app.service(s, defToArray(App.services[s]));
However, the line defToArray(App.services[s])
is throwing an error stating "Index signature of object type implicitly has an 'any' type".
I've attempted to cast it using
defToArray(<any>App.services[s])
and defToArray(App.services[s] as any)
, but neither solution has worked.
Any suggestions on how to resolve this issue?