【发布时间】:2020-09-16 03:48:04
【问题描述】:
我有 2 个函数 func1 和 func2,只有在 func1 执行后我才需要执行 func2。下面是代码
home.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-home',
templateUrl: './home.component.html',
styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {
constructor() { }
ngOnInit() {
this.func1();
this.func2();
}
func1(){
console.log('function1')
}
func2(){
console.log('function2')
}
}
【问题讨论】:
-
在
func1内打电话给func2?
标签: angular typescript