SHARE
TWEET

Untitled

a guest Jan 29th, 2016 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, View, Input } from 'angular2/core';
  2.  
  3. @Component({
  4.     selector: "clock"
  5. })
  6. @View({
  7.     template: `<input [ngModel]="now" type="date" id="time" />`
  8. })
  9.  
  10. export class ViewportComponent {
  11.  
  12.     public now: Date;
  13.  
  14.     constructor() {
  15.         this.now = new Date();
  16.         setInterval(this.onTimer, 1000);
  17.     }
  18.     public onTimer() {
  19.         this.now = new Date();
  20.     }
  21.  
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top