angular子页面调用父页面方法

xiaoxiao2025-06-09  9

父页面html <res-card open-video-play = "openVideoPlay(dataArr,resourceStr,playType)" ></res-card>

--ps 注意: open-video-play 为子页面调用方法  子页面调用的时候横线转大写

父页面js

$scope.openVideoPlay = function (dataArr,resourceStr,playType) { };

子页面调用js

var singleshipingList = []; singleshipingList.push(dgSource); scope.openVideoPlay({dataArr:singleshipingList,resourceStr:data.data});

--ps 注意  子页面调用的时候方法参数以对象形式穿,并且对象名和父页面定义的对象名必须一样

转载请注明原文地址: https://www.6miu.com/read-5031551.html

最新回复(0)