Skip to content

Commit be66a5e

Browse files
authored
Add files via upload
1 parent 4469915 commit be66a5e

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

src/app/demo2/demo2.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<h1>Demo2 Componenet Load</h1>
2+
<h4>{{data}}</h4>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { Demo2Component } from './demo2.component';
4+
5+
describe('Demo1Component', () => {
6+
let component: Demo2Component;
7+
let fixture: ComponentFixture<Demo2Component>;
8+
9+
beforeEach(async(() => {
10+
TestBed.configureTestingModule({
11+
declarations: [ Demo2Component ]
12+
})
13+
.compileComponents();
14+
}));
15+
16+
beforeEach(() => {
17+
fixture = TestBed.createComponent(Demo2Component);
18+
component = fixture.componentInstance;
19+
fixture.detectChanges();
20+
});
21+
22+
it('should create', () => {
23+
expect(component).toBeTruthy();
24+
});
25+
});

src/app/demo2/demo2.component.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import {
2+
Component, Input, OnInit,
3+
ComponentFactoryResolver, ViewContainerRef, ViewChild, ElementRef, Renderer2, AfterContentInit
4+
} from '@angular/core';
5+
6+
@Component({
7+
selector: 'app-demo2',
8+
templateUrl: './demo2.component.html',
9+
styleUrls: ['./demo2.component.css']
10+
})
11+
export class Demo2Component implements OnInit {
12+
13+
@Input() data: any;
14+
constructor(
15+
private el: ElementRef,
16+
private ren: Renderer2,
17+
private resolver: ComponentFactoryResolver
18+
) {}
19+
20+
ngOnInit() {
21+
console.log(this.data);
22+
}
23+
24+
}

0 commit comments

Comments
 (0)