我在我的项目中使用Laravel 5.4并尝试使用Mix设置前端构建系统.一切都工作正常,除了我无法获得浏览器自动重新加载选项.文档上没有任何内容.
有人请帮忙,我该怎么做?
在 Angular 上,我尝试使用以下正则表达式验证电子邮件 -
^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$
Run Code Online (Sandbox Code Playgroud)
如下图——
createGroupForm() {
this.childGroupForm = new FormGroup({
'groupName': new FormControl(null, Validators.compose([
Validators.required
])),
'groupEmail': new FormControl(null, Validators.compose([
Validators.pattern('^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$')
]))
});
}
Run Code Online (Sandbox Code Playgroud)
但看起来它不起作用。它总是显示“电子邮件无效。”,即使它是有效的。
在我的angular 6项目中,我有一个动态创建的组件,如下所示:
@Component({
selector: 'app-staff-dash',
template: `
<template #tasksContainer></template>
`
})
export class StaffDashComponent implements OnInit {
componentRef: any;
factory: any;
@ViewChild('tasksContainer', { read: ViewContainerRef }) tasksEntry: ViewContainerRef;
constructor(
@Inject(ComponentFactoryResolver) private resolver: ComponentFactoryResolver
) {
}
ngOnInit() {
this.createTasksComponent();
}
createTasksComponent(): void {
this.tasksEntry.clear();
this.factory = this.resolver.resolveComponentFactory(TasksComponent);
this.componentRef = this.tasksEntry.createComponent(this.factory);
}
}
Run Code Online (Sandbox Code Playgroud)
StaffDashComponent是父母,TasksComponent是孩子。现在,我希望将一些数据从传递TasksComponent到StaffDashComponentusing @Output。我该如何实现?