From 2acd8a6f8cc3d09a786058a7333eb4a2aa9b98b8 Mon Sep 17 00:00:00 2001 From: gdi2290 Date: Thu, 5 Nov 2015 09:54:28 -0800 Subject: [PATCH] feat(app.ts): include universal directive --- src/app.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index 9f5daaf99..c567d2bd2 100644 --- a/src/app.ts +++ b/src/app.ts @@ -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: `
-

Hello, {{ name }}!

+
+ Hello, {{ name }}! +
+ name:
`