title: Equivalent to route guards for component functions
body: <p>I'm wondering if there is an equivalent to route guards for angular component functions (specifically click events). </p>
  
  <p>We've got a route guard set up that opens a login page when not logged in. This works great. The problem is, we have a component that does not require authentication to view, but some of the functionality within the component does require authentication. For example, a list of news articles, but the upvote/downvote buttons require authentication to use. </p>
  
  <p>The upvote/downvote buttons are simply click events firing component functions. We can take the logic we are using in our custom route guard, and add it to these functions, but this leads to quite a bit of duplicate code. </p>
  
  <p>I was wondering if Angular has anything built in that can solve this. I'm thinking something similar to ASP.NET MVC's [Authorize] attribute that you can put at the top of an action to authenticate. As far as I can tell, route guards only work for routes, and not click events. </p>