我是角度4的新手,试图从单元测试中测试一个角度4特征router.paramMap,以下面的方式读取路径参数并在我的应用程序中按预期工作.
constructor(private router:Router, private actRoute:ActivatedRoute) {
}
ngOnInit() {
this.router.paramMap.subscribe(params => {
params.get(id);
})
......
}
Run Code Online (Sandbox Code Playgroud)
但是在运行单元测试的时候,即使我通过传递路径参数,我也得到了不能调用未定义的订阅方法的错误.
{
provide: ActivatedRoute,
useValue: { params: Observable.of({id: 1}) }
}
Run Code Online (Sandbox Code Playgroud)
请建议
我在我的窗户上安装Rails 3.我安装了最新的ruby 2.0.0,我更新了宝石.但是当我使用gem install rails安装rails时,成功的消息已经出现,但最后我发现了
ERROR: Error installing rails:
The 'atomic' native gem requires installed build tools
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
Run Code Online (Sandbox Code Playgroud)
请帮助我......
当我们在java中已经有response.setContentType时,我是否知道使用response.addHeader ...我找不到合适的解决方案.
<% response.addHeader("Content-Disposition","attachment;filename=Report.xls"); %>
<% response.setContentType("application/vnd.ms-excel"); %>
Run Code Online (Sandbox Code Playgroud)
这里的上述第二个语句足以将响应作为excel格式.哪个场景我需要使用response.addHeader?
请 ...