我的angular2应用程序将存在于现有的内容管理系统中。因此,我需要捕获由这个CMS生成的一些“变量”(比如auth令牌等),并在我的angular2应用程序中使用它们。例如(我正在使用打字本):import {OnInit} from 'angular2/core';
@Injectable我可以通过在
我得到了一个Angular2 2服务,它应该从像这样的URL返回参数。constructor(private route: ActivatedRoute) { }
return this.route.snapshot.queryParams.foobar;}error TS2339: Property 'foobar' does not exist on