By writing declare var angular you are simply telling Typescript to trust you that it exists, even though it hasn’t seen it be imported into the scope of this file.
https://stackoverflow.com/questions/56048760/why-is-declare-var-angular-necessary-when-using-typescript-with-angularjs
告诉TypeScript,开发人员肯定变量window已经被定义,虽然看起来并未在当前文件的作用域内被导入。