Open Emmachen opened 8 years ago
something about eventBust1.0 eventbust相当于事件中间的沟通信道。在sapui5中,可以在不同的controller中,share事件。 两个方法:subscribe/publish.一个声明,一个使用。 ex: 参数1:“声明chanel”,随便给,为了让publish知道是哪里的 参数2:事件id, 参数3:事件发生时调用的函数 参数4:listener 参数1:channel id 参数2:event id 参数3:事件需要的数据 在subscribe时: 将channel放到oEventBus中: 将声明的事件放到mEventRegistry:
返回:
在publish: 当执行到press中publis方法,获取eventBus,在subscribe中已经有值: 执行到publish方法: 获取channel: 跳到事件:
已阅!
something about eventBust1.0 eventbust相当于事件中间的沟通信道。在sapui5中,可以在不同的controller中,share事件。 两个方法:subscribe/publish.一个声明,一个使用。 ex: 参数1:“声明chanel”,随便给,为了让publish知道是哪里的 参数2:事件id, 参数3:事件发生时调用的函数 参数4:listener 参数1:channel id 参数2:event id 参数3:事件需要的数据 在subscribe时: 将channel放到oEventBus中: 将声明的事件放到mEventRegistry:
返回:
在publish: 当执行到press中publis方法,获取eventBus,在subscribe中已经有值: 执行到publish方法: 获取channel: 跳到事件: