0
我有一個角度應用程序(TypeScript)安裝程序,其中父組件包含另一個子組件。 城市組件(子)發出Ajax請求以加載需要大約2秒的數據(城市)。如何在父親之前加載子組件
@Component({
providers: [UserService],
template: `<city [city]='user.city' (citySelected)="user.city = $event"></city>`
})
export class FormComponent implements OnInit{
private user:User = new User();
....
問題,我需要城市組件在父組件之前先加載。
你在哪裏在'ngOnInit()'城市組件中發出ajax請求? – Searching
是的。我在ngOnInit()中做了ajax請求。 –
我的應用:(http://www.renatodev.com.br/ |登錄:演示|密碼:demo123)當我編輯記錄時,州和城市出現延遲。 –