小编Sel*_*mud的帖子

Laravel 5.4 - 混合 - 如何运行浏览器实时重新加载

我在我的项目中使用Laravel 5.4并尝试使用Mix设置前端构建系统.一切都工作正常,除了我无法获得浏览器自动重新加载选项.文档上没有任何内容.

有人请帮忙,我该怎么做?

elixir-mix laravel-5 laravel-elixir

17
推荐指数
4
解决办法
2万
查看次数

在反应形式上使用正则表达式进行 Angular 7 电子邮件验证

在 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)

但看起来它不起作用。它总是显示“电子邮件无效。”,即使它是有效的。

regex forms validation angular

4
推荐指数
1
解决办法
7210
查看次数

来自Angular 6中动态创建的组件的@Output

在我的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是孩子。现在,我希望将一些数据从传递TasksComponentStaffDashComponentusing @Output。我该如何实现?

angular angular6

2
推荐指数
1
解决办法
1329
查看次数