将表单数据传递给有角度的解析器

时间:2018-06-06 09:45:27

标签: angular angular5

我正在从FORM提交一些值,现在我需要知道如何将这些值传递给解析器。

我正在传递我从component.ts

收到的值
valuesReceivedFromForm(){

    const tt=  this.myFrom.value; // These are the values I need to pass to the resolver
    this.router.data.subscribe((any: any) => {


    });

解析器

@Injectable()
export class MyResolver implements Resolve<any> {
    constructor(private service{}
    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {     
        // How to retrieve the values that was in my form here.
        return this.service.sendToPerson( xxxxxx );
    }
}

0 个答案:

没有答案