我能够收集对象中传递的数据initialState,例如在这段代码中:
const initialState = {\n titulo: titulo,\n origen: origen,\n th1: "N\xc3\xbamero",\n th2: "Nombres",\n modalFor: "Locales"\n };\n this.bsModalRef = this.modalService.show(ClienteOlocalPopUpComponent, {\n initialState,\n backdrop: "static",\n keyboard: false\n });\nRun Code Online (Sandbox Code Playgroud)\n\n并在 ClienteOlocalPopUpComponent.html 中插入其属性。
\n\n但是,如果我希望传递给模态的值const initialState,比方说,通过ngOnInit()ClienteOlocalPopUpComponent.ts \xc2\xbf 的方法在控制台中打印,我该如何实现呢?它在模态的 .ts 文件中无法识别。
谢谢。
\n\n这是启动模式的组件的代码:
\n\n openModal(origen, titulo) {\n this.origen = origen;\n\n if (origen === "cliente") {\n const initialState = {\n titulo: titulo,\n origen: origen,\n th1: "RUT",\n th2: "Nombres",\n modalFor: "Clientes",\n rutClientes: this.requestTres.rutCliente,\n rutOperador: this.requestTres.rutOperador\n };\n this.bsModalRef …Run Code Online (Sandbox Code Playgroud)