No ‘Access-Control-Allow-Origin’ header is present on the requested resource
web服务为本地服务时,需要在后台添加header
httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
angular2 dialog传值bean
let config = new MdDialogConfig();
config.data = this.chooseUser;
let dialogRef = this.dialog.open(AddUserComponent, config);
constructor(private addUserService: AddUserService,
public dialogRef: MdDialogRef<AddUserComponent>) {
this.currentSex = 1;
this.user = dialogRef._containerInstance.dialogConfig.data;
}