I'm having trouble accessing a function from another export function within the same TypeScript file. Can anyone help me with this?
app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'bus-poc';
ngOnInit(): void {
}
addingNumber(total:any){
console.log(total);
}
}
export function sum(a: number, b: number) {
const num = a + b;
this.addingNumber(num);
}
hello.component.ts:
import { sum } from './another-file';
sum(50, 10);