const table1 = await page.$$eval('table:nth-child(3) tbody', tbodys => tbodys.map((tbody) => {
// add logic here!
let parsedTable = '';
let extractedTRs = tbody.match(/<tr>(.*?)<\/tr>/g); // find a way to deconstruct this or regex. what is the type of tbody?
extractedTRs.map( tr => {
const tr= str.match(/<td>(.*?)<\/td>/g); //this should return an array...someone check me :)
parsedTable += `tr[0]:'${tr[1]}' \\n`);
}
return parsedTable;
}));
从此代码中,我无法加载ProtocolloModule。当我从路由中写“ configurazione / protocollo”时,我陷入了“ configurazione”路径中。我该如何解决? 如果我在第二个孩子中插入loadModule,那么一切都很好。如何使它以这种方式工作?
答案 0 :(得分:0)
const routes: Routes = [
{
path: '',
component: ProtocolloGestioneComponent,
data: { breadcrumbs: 'Protocollo' },
children: [
{
path: 'crea',
component: ProtocolloCensimentoSidenavComponent,
canDeactivate : [CanDeactivateGuard]
}
],
},
{ path: '**', redirectTo: '' }
]
@NgModule({
declarations: [],
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ProtocolloRoutingModule { }
这是协议的路由,我无法理解缺少的内容,或者尚未放入嵌套方式。
答案 1 :(得分:0)
我设法使它起作用。 组件配置模板中没有。现在,我遇到另一个问题,在配置/协议中,我同时拥有配置模板和协议模板,就好像指令不会从视图中切换一样