Skip to content

Commit

Permalink
get container element
Browse files Browse the repository at this point in the history
  • Loading branch information
myungjaeyu committed May 25, 2017
1 parent 6c06fad commit be1612f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<h1>
{{title}}
</h1>
<div #container></div>
15 changes: 12 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
import { Component } from '@angular/core';
import { Component, OnInit, ElementRef, ViewChild} from '@angular/core';
import * as THREE from 'three';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'app works!';
export class AppComponent implements OnInit{

@ViewChild('container') elementRef: ElementRef;
private container : HTMLElement;

constructor(){
console.log(THREE);

}

ngOnInit(){
this.container = this.elementRef.nativeElement;

console.log(this.container);

}
}

0 comments on commit be1612f

Please sign in to comment.