シンプルな$ scopeコントローラの練習をしようとしています。テキスト値が正しいもの...
<scope-test>
<h2>My Name?</h2>
<input type="text" ng-model="text"/>
<p>{{text}} {{result}}</p>
</scope-test>
であり、これはアプリであればアプリは、結果の発現を示す必要があります...
angular.module('angular-tests', [])
.directive('scope-test', function(){
return{
restrict:'E',
controller: function($scope){
if ($scope.text === "alex") {
$scope.result = "is correct!";
} else {
$scope.result = "is not correct!";
}
}
};
});
NG-モデルが正常に動作して唯一のものです。
ありがとうございます!
これは機能しました。ありがとう! – cerealex