title: Binding a logout method in angular
body: <p>I am trying to bind a logout function to a menu item that is being populated dynamically, When someone clicked logout it signs out the user. I have tried the follow code but seems not to be working.</p>
  
  <p>Here is my <code>component.ts</code> file</p>
  
  <pre><code>usermenu: Object[] = [ {
      icon: 'tune',
      route: '/dashboard/settings',
      title: 'Account settings'
    }, {
      icon: 'exit_to_app',
      route: '',
      title: 'Sign out',
      method: 'logout()'
    },
  ];
  
  logout(){
    //my code
  }
  </code></pre>
  
  <p>My <code>template.html</code></p>
  
  <pre><code>  &lt;md-nav-list&gt;
      &lt;a *ngFor="let item of usermenu" [routerLink]="item.route" md-list-item (click)="item.method" &gt;&lt;md-icon&gt;{{item.icon}}&lt;/md-icon&gt;{{item.title}}&lt;/a&gt;
    &lt;/md-nav-list&gt;
  </code></pre>
  
  <p>For example when I click on account setting it redirects to setting comment, which is simple in this case. For signing out it won't be a component but a method which I have created <code>logout()</code>. Am looking on way I can bind it to the route when clicked it will log the user out.</p>