1
我已經在angularJS中編寫基本代碼來打印用戶輸入。它的工作在鉻,但不是在Firefox。附加html和js文件。任何人都可以請幫我解決這個問題。Firefox瀏覽器問題
var application = angular.module('mainApp', []);
application.controller('app', function($scope){
\t $scope.Inputs = [];
\t $scope.searchEnter = function() {
\t \t if(event.which == 13 && $scope.Input != "")
\t \t {
\t \t \t $scope.addInput();
\t \t }
\t };
\t $scope.addInput = function(){
\t \t $scope.Inputs.push($scope.Input);
\t \t $scope.Input = '';
\t \t };
}); \t
<!DOCTYPE html>
<html lang="en">
\t <head>
\t \t <meta charset="UTF-8">
\t \t <title>get the input from user and print on page</title>
\t \t <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
\t \t <script src="controller.js"></script>
\t \t </head>
\t \t \t \t <body ng-app="mainApp" ng-controller="app">
\t \t \t \t \t <h2 style="color:blue"> Enter the input value</h2>
\t \t \t \t \t <input type="text" ng-model="Input" ng-keyup="searchEnter()">
\t \t \t \t \t <div id="InputsToPrint">
\t \t \t \t \t \t <ol>
\t \t \t \t \t \t \t <li style="font-size:14px; font-weight:bold; text-transform:capitalize; font-style=italic; color:green" ng-repeat="firstInput in Inputs">
\t \t \t \t \t \t \t \t {{firstInput}}
\t \t \t \t \t \t \t </li>
\t \t \t \t \t \t </ol>
\t \t \t \t \t </div>
\t \t \t \t </body>
</html>
在Firefox中輸入值不打印頁面。
謝謝潘卡。它的工作很好 – Jayasree
@Jayasree很高興聽到這個消息,請接受答案,以便它也能幫助其他人。謝謝 :-) –