How to implement CanActivate guard in Angular2
<p>I am trying to implement "CanActivate" method in my service, and below is the
service code</p>

<pre><code>import { Injectable } from '@angular/core';
import { CanActivate } from '@angular/router';

@Injectable()
export class GuardUserSearchService implements CanActivate {

    CanActivate() {
        console.log('dummy guard clause for User search');
        return true;
    }
}
</code></pre>

<p>When I compile this typeScript code , it is displays following error</p>

<blockquote>
  <p>Class 'GuardUserSearchService' incorrectly implements interface 'CanActivate'.</p>
</blockquote>

<p>Any idea what is the issue in my code.</p>