LoginSignup
2
0

More than 3 years have passed since last update.

AngularJS(v1.x系)でng-modelにはprimitive型は使えないみたい

Last updated at Posted at 2019-06-17

inputで入力した値がcontrollerで受け取れず、undefinedになってしまうという事象に遭遇しました。
調べてみると、ng-modelにプリミティブ型の値を指定するとcontrollerで受け取れない仕様みたいでした1

オブジェクトのプロパティとして渡してあげると良いです。

変更履歴

2019年6月18日
Angular2.0以降では、primitive型もng-modelで使えるみたいでした。
なので、タイトルに修正を入れました。
@lacolaco さんご指摘ありがとうございました。

2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0