私はこれを私のHTMLビューで持っています。未定義の赤いプロパティはありません
<form name="adduser" id="signupForm" novalidate>
<span>First Name</span>
<label class="item item-input" id="profileLabel">
<input id="profileInput" type="text"
ng-model="user.fname"
class="form-control"
placeholder="{{fnamePlaceholder}}"
ng-minlength="1" >
</label>
<div id="name-group" class="form-group-lg">
<button type="submit" ng-click="updateData(user)" id="initiateSignUp" class=" button button-positive button-block" >
Save and continue
</button>
</div>
</form>
と、これは私のコントローラ
$scope.updateData=function(user){
console.log (user.fname)
}
のスタートですが、私はあなたがでundefined
あるオブジェクトのプロパティを設定している
TypeError: Cannot read property 'fname' of undefined
あなたの '$ scope'とは何ですか? $ scopeがユーザの場合、ng-model = "fname"だけではありません。問題はユーザーが未定義であることです。 –