In my angular2 application, I have a js file "connection.conf.js" with var:
var appTypeConf = "example-app";
The component uses the variable from "connection.conf.js":
declare var appTypeConf: string; export class Component { public appType = appTypeConf; }
It works in my application, but when I test the application with karma, I get an error message:
ReferenceError: Can't find variable: appTypeConf (line 9)
How to declare a variable in the component specification file?
source share