Angularjs pubsub vs $broadcast
hassassin提出了一个问题：Angularjs pubsub vs $broadcast，或许与您遇到的问题类似。
I don’t think you are missing anything. You’ve successfully outlined the pros/cons of each approach.
$on approach doesn’t require you to unsubscribe, but it is not terribly efficient as it broadcasts to all the scopes. It also has a very low barrier to entry. You don’t need to inject any services, you don’t need to create them. They broadcast to everyone, so it is a more simple approach.
The pub/sub approach is much more direct. Only subscribers get the events, so it isn’t going to every scope in the system to make it work. It is more complex, however, because you need to write your service with callback handlers, and you have to remember to unsubscribe. The remembering to unsubscribe is pretty huge in my opinion. If you don’t get this right, you get memory leaks. And you won’t know it until it is a problem in 3 months.
I can see why the built-in approach is