angular的发布订阅

import subject from "nxjs/subject";

let sub = new subject();

//发布订阅
sub.subscribe(data=>{
  console.log(data>
});

//执行订阅的事件
sub.next(data);

 

posted @ 2020-03-15 08:27  LLC-Mite  阅读(313)  评论(0编辑  收藏  举报