Created
March 9, 2019 03:15
-
-
Save t-palmer/386b7709ba92bc3e57ac138e04280a24 to your computer and use it in GitHub Desktop.
Example child component for viewchild-unit-test-example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-child', | |
template: `Timestamp: {{timeStamp}}` | |
}) | |
export class ChildComponent implements OnInit { | |
public timeStamp: Date; | |
ngOnInit() { | |
this.updateTimeStamp(); | |
} | |
updateTimeStamp() { | |
this.timeStamp = new Date(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment