appComponent.ts
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
name = 'Angular';
@ViewChild('self_user3') self_user3: string;
ngOnInit(): void {
const article = document.querySelector('#self_user');
document.getElementById('self_user1').textContent = '<b>Mr. Pukar</b>';
document.getElementById('self_user2').innerHTML = '<b>Mr. Pukar</b>';
console.log(this.self_user3.nativeElement.value);
}
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
name = 'Angular';
@ViewChild('self_user3') self_user3: string;
ngOnInit(): void {
const article = document.querySelector('#self_user');
document.getElementById('self_user1').textContent = '<b>Mr. Pukar</b>';
document.getElementById('self_user2').innerHTML = '<b>Mr. Pukar</b>';
console.log(this.self_user3.nativeElement.value);
}
}
appComponent.html
0 comments:
Post a Comment