技術

Angular6で子コンポーネントに文字列を渡す

投稿日:

文字列と変数の値を渡す時、記述が少しだけ違います。

// 文字列を渡したい時
<app-example testText="hogehoge"></app-example>

// 変数を渡したい時
<app-example [testText]="hogehoge"></app-example>

簡単ですね。

-技術

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

関連記事

[Xcode] SDK Version Issue – This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.

こんにちは。たなかです。 2019年、ブログ初更新になります。今年もよろしくお願 …

no image

【ionic】タブをタップで最上部にスクロール!

どうも、中田です。 今日はタブをタップでトップにゴーの日です。 どういう日かとい …

no image

【javascript】連想配列から特定の条件で新しい配列を作成する

こんにちは javascriptにはfilterという便利な関数があります。 例 …

[XCode] clang: error: linker command failed with exit code 1

どうも中田です 本日はシンプルに。 XCodeでbuild時に発生しました。 エ …

[Rails] モデルが初期化されてないとな(not initialized)

どうも中田です Railsで、modelの initialize に処理を追加す …