Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MacKentoch/0d2d307c06cee456f8d06329d892a8cd to your computer and use it in GitHub Desktop.
Save MacKentoch/0d2d307c06cee456f8d06329d892a8cd to your computer and use it in GitHub Desktop.
// Angular2
import {Component, Input} from 'angular2/core';
import {$service1} from './service1';
import {$service2} from './service1';
@Component({
selector : 'demo-directive',
providers : [$service1, $service2],
template : `
<div>
<h1>
{{title}}
</h1>
<p>
{{demoAttr1}}
</p>
<p>
{{demoAttr2}}
</p>
</div>
`,
styles : [``]
})
export class AppQuizEnd {
@Input() demoAttr1: string;
@Input() demoAttr2: string;
public myData: any;
constructor(service1: $service1, service2: $service2) {
this.init();
}
public init(): void {
this.title = this.service1.getTitle();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment