Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
feat(app.ts): include universal directive
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickJS committed Nov 5, 2015
1 parent bd7a83d commit 2acd8a6
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
import {Component} from 'angular2/angular2';
import {Component, Directive, ElementRef, Renderer} from 'angular2/angular2';


@Directive({
selector: '[x-large]'
})
class XLarge {
constructor(element: ElementRef, renderer: Renderer) {
// we must interact with the dom through Renderer for webworker/server to see the changes
renderer.setElementStyle(element, 'fontSize', 'x-large');
}
}


@Component({
selector: 'app',
directives: [ XLarge ],
template: `
<div>
<h1>Hello, {{ name }}!</h1>
<div>
<span x-large>Hello, {{ name }}!</span>
</div>
name: <input type="text" [value]="name" (input)="name = $event.target.value" autofocus>
</div>
`
Expand Down

0 comments on commit 2acd8a6

Please sign in to comment.