outlet connector hbsでユーザーデータにアクセスする方法は?

I am working on a plugin that has to render a notice to some specific users in the top area of the website where notices show up. The plugin outlet that I am trying to override is:
{{plugin-outlet name="top-notices" tagName="" args=(hash currentPath=router._router.currentPath)}}

I am able to get a static version of the connector to work. I created the following file at this path: plugins/discourse-user-throttle/assets/javascripts/discourse/templates/connectors/top-notices/throttle_info.hbs



This line is working file. But the username does not show
{{{user.username}}}

The issue I am facing is that the {{{user.username}}} doesn’t username. How can that be done?

I found out using console log that the user is accessible as currentUser:

{{{currentUser.displayName}}}

「いいね!」 1

Hi、currentUserのプロパティを表示する方法について、何かガイダンスはありますか?どのように、またはどこでそれをログに記録/表示すればよいのかわかりません。currentUserの名前をアクセスして、ページに表示できるようにしたいです。

こんにちは。

テンプレート内にデータを記録する方法についてお尋ねの場合、{{log data_here}} を使用すると、ブラウザのコンソールに表示されます。

API api.getCurrentUser() を使用することもできます。
例えば、テーマ/コンポーネントのHTMLの <head> セクションで次のように使用します。

<script type="text/discourse-plugin" version="0.8">
  console.log(api.getCurrentUser());
</script>
「いいね!」 1