如何在加载时设置自动完成输入框数据?

How to set auto complete input box data on load?

我正在做一个项目,其中需要在父组件的 ngInit() 上设置文本输入数据。

基本上我有一个组件,它是一个 Google AutoComplete 下拉列表,并且我有主 HTML 页面,我在其中填充该组件。

如何从调用此组件的主页设置值?

我正在关注与 This Tutorial.

完全相同的源代码

这里我有一个 AutocompleteComponent 负责在下拉列表中显示地点。还有这个 从 app.component.html 加载。

我想为 app.component.ts AutoCompleteComponent addresstext 输入文本框设置一些值。可能来自 app.component.tsngInit()

我怎样才能做到这一点?

使用 Angular 的 @Input 属性 将数据从父组件发送到子组件

https://angular.io/guide/component-interaction