0
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.7/angular.js"></script>
<body ng-app="myApp">
<div ng-controller="toDoCtrl">
<div>
<hr>
<form class="form" name="commentForm" ng-submit="vm.submitCommentForm()">
<div class="form-group">
<label for="fieldBody">Comment:</label>
<textarea name="body" id="fieldBody" class="form-control" rows="3"
ng-change="vm.changeCommentForm()"
ng-model="vm.commentForm.body"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" ng-disabled="!vm.validCommentForm">Comment</button>
</div>
</form>
<hr>
</div>
</div>
スクリプト角度表現はNG-無効
var app = angular.module('myApp', []);
app.controller('toDoCtrl', function() {
var vm = this;
vm.validCommentForm = true;
})
では動作しません。「コメント」ボタンは、私はハードコーディングした場合に想定さとしてvm.validCommentForm = true
が一方ng-disabled=0
コメントボタンは、作業表示されたときに無効になって表示されます。何が間違っていたのですか?あなたはcontrollerAs
方法論を使用しますがビューの別名を設定していない