私のコントローラ
App.controller('Ctrl', ['$scope', function ($scope) {
$scope.user = {};
$scope.view = function() {
console.log($scope.user);
console.log($scope.user.length);
}]);
マイHTML
<input type="text" ng-model="user.lastname" />
<input type="email" ng-model="user.email" />
<input type="text" ng-model="user.address" />
<input type="email" ng-model="user.id" />
<input type="text" ng-model="user.city" />
<input type="email" ng-model="user.country" /> ---> This will be a select
ないフィールドは必須です言う、私は、ユーザー入力に基づいて検索機能をしなければなりません。ユーザーが少なくとも1つのデータを提供する必要があることを1つだけ検証する必要があります。上記のようにコンソールを置くと、最初の値が表示されますが、.lengthコンソールはundefinedを返します。