Switch between two services in Angular2
<p>Let's say i have </p>

<pre><code>import {ServerService} from './server-service'
import {ServerServiceMock} from './server-service-mock'
</code></pre>

<p>and</p>

<pre><code>constructor (
    private serverService: ServerService
) {}
</code></pre>

<p>How would I switch programmatically lets say with a method, between both services? Needless to say there is lots of code depending on this.</p>

<p>Or maybe go into the services itself?</p>

<pre><code>export class AuthZeroLockService {
    if buttonSwitch == true {
        return {//normalservice}
    } else {
        return {//mockedservice}
    }
}
</code></pre>