私は簡単なAngular JSコードを書いています。私は初心者です。しかし、私の表現の一つは評価されていません。助けが必要。評価されたが、ボタンの上にあるとして表示さ取得されていない{{isHidden ? 'Show Available Colors' : 'Hide Available Colors'}}
-Angular JS式が評価されていない
var myAppModule = angular.module('myAppModule', []);
myAppModule.controller('myController', function($scope){
\t // Hide colors by default
\t $scope.isHidden = true;
\t
\t // a function, placed into the scope, which
\t // can toggle the value of the isHidden variable
\t $scope.showHideColors = function() {
\t $scope.isHidden = !$scope.isHidden;
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<!DOCTYPE html>
<html ng-app="myAppModule">
<head>
<title>Angular JS</title>
\t <script src="js/angular.min.js"></script>
<script src="js/myAppModule.js"></script>
\t <style>
\t \t body {
\t \t font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif;
\t \t }
\t \t div {
\t \t \t margin: 20px;
\t \t \t padding: 20px;
\t \t \t font-size: 16px;
\t \t \t color:#ffffff;
\t \t }
\t \t #red {
\t \t \t background-color: red;
\t \t }
\t \t #green {
\t \t \t background-color: green;
\t \t }
\t \t #blue {
\t \t \t background-color: blue;
\t \t }
\t \t #purple {
\t \t \t background-color: purple;
\t \t }
\t \t #gray {
\t \t \t background-color: gray;
\t \t }
\t \t #olive {
\t \t \t background-color: olive;
\t \t }
\t </style> \t
</head>
<body ng-controller="myController">
\t \t <h2>AngularJS Socks</h2>
\t \t <p>Keep warm this winter with our 100% wool, 100% cool, AngularJS socks!</p>
\t \t
\t \t <button ng-click="showHideColors()" type="button">
\t \t \t {{isHidden ? 'Show Available Colors' : 'Hide Available Colors'}}
\t \t </button>
\t \t <div id="red" ng-hide="isHidden">Red</div>
\t \t <div id="green" ng-hide="isHidden">Green</div>
\t \t <div id="blue" ng-hide="isHidden">Blue</div>
\t \t <div id="purple" ng-hide="isHidden">Purple</div>
\t \t <div id="gray" ng-hide="isHidden">Dark Slate Gray</div>
\t \t <div id="olive" ng-hide="isHidden">Olive</div>
</body>
</html>
表現 - 以下のコードをご確認ください。私が逃したものについての手がかりはありません。前もって感謝します。
ありがとうございました。それは正しいです。それは私のために働いた。 :) – Rohit