polymer ts test file

This commit is contained in:
lgrignon
2015-12-11 08:40:27 +01:00
parent 82764e58b4
commit 9abd523d14
2 changed files with 39 additions and 6 deletions
+38
View File
@@ -0,0 +1,38 @@
/// <reference path="./polymer-ts.d.ts"/>
namespace Components {
export class TestComponent extends polymer.Base {
public field: string = 'foo';
public is: string;
constructor() {
super();
this.is = 'test-test';
}
public ready(): void {
console.log('ready');
this.async(() => {
console.log('delayed');
}, 500);
}
}
polymer.createElement(TestComponent);
@component('test-annotated')
export class AnnotatedComponent extends polymer.Base {
public field: string = 'xx';
constructor() {
super();
}
public ready(): void {
console.log('annotated ready');
}
}
}
+1 -6
View File
@@ -1,8 +1,3 @@
// Type definitions for PolymerTS 0.1.17
// Project: https://github.com/nippur72/PolymerTS
// Definitions by: Louis Grignon <https://github.com/lgrignon/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module polymer {
class PolymerBase extends HTMLElement {
$: any;
@@ -93,7 +88,7 @@ declare module polymer {
type?: any;
value?: any;
reflectToAttribute?: boolean;
readonly?: boolean;
readOnly?: boolean;
notify?: boolean;
computed?: string;
observer?: string;