Click here to Skip to main content
14,695,387 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
import { Component } from '@angular/core';
@Component({
  selector: 'app-root',
  template: `
  <p>Alive!</p>
  <app-vp-root></app-vp-root>`,
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  someVariable: someType = somevalue 
  someFunction(){
     console.log(this.someVariable)
  }


 ***//can i access through other than this.someVariable line AppComponent.someVariable;***


}


What I have tried:

sometimes there may be situation like using bootbox function in which 'this' does not refers to 'AppComponent' so one must use 'es arrow' function to achieve this so is there any way other than this
Posted
Updated 22-Sep-20 6:56am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900