Q:

Angular's exportAs usage difference between ver 2 and 4?

I have a working PLNKR written with angular version2.
It's a simple timer where the component has a reference to the directive which contains the logic : 
@Component({
  selector: 'my-app',
   template: `
    <div>
     <div class="timer" *simpleTimer="#timer=timerApi">       <-- see here
     <div class="time">{{ timer.getTime() }}</div>
      ...
    </div>
  `

and in the directive itself - it sets the value for timerApi via  : 
  view.setLocal('timerApi', api);

The directive doesn't use exportAs : 
@Directive({
  selector: '[simpleTimer]'
})

I want to convert it to Angular 4. but some features doesn't work.
For example , the following code :  *simpleTimer="#timer=timerApi" yields  : 

Parser Error: Unexpected token # at column 1 in [#timer=timerApi]

Also this method view.setLocal doesn't exist anymore.
Question:
How can I reference the directive from the component ? ( so i'll have all its methods) 
I've added the exportAs to the directive and it still doesn't work.
The problematic Plunker converted to ver 4.2.3

A:

There is second parameter for vcRef.createEmbeddedView which expects the context:
let api = {
  toggle: () => this.toggle(),
  reset: () => this.reset(),
  getTime: () => this.getTime()
};
let view = this.viewContainer.createEmbeddedView(this.templateRef, { timerApi: api });

Usage:
*simpleTimer="let timer = timerApi"

Fixed Plunker v4.2.3
Another option
let view = this.viewContainer.createEmbeddedView(this.templateRef, { $implicit: api });

and template
*simpleTimer="let timer"

Plunker

