0
私はすべてうまくやっていると思いますが、まだこのエラーが発生しています。誰も私を導いてください。私は最初のMyFunctionがあり、第二はgoAndFindですが、最初のNG-変化に正常に動作しているが、onclickのボタンの両方の機能をdoesntの仕事私のjavascriptのファイルに2つの機能があります。未知のReferenceError:goAndFindはHTMLInputElement.onclickで定義されていません
が、これは私のjavascriptのファイルである
/// <reference path="angular.min.js"/>
// Initialize Firebase
var config = {
apiKey: "AIzaSyDTTDn-oR0XadcSwllwUkukrw86eH2Ch0g",
authDomain: "mvprecovery.firebaseapp.com",
databaseURL: "https://mvprecovery.firebaseio.com",
storageBucket: "mvprecovery.appspot.com",
messagingSenderId: "119468568560"
};
firebase.initializeApp(config);
var myapp = angular
.module("mymodule", ['firebase'])
.controller("mycontroller", function ($scope , $firebaseObject) {
$scope.selectState;
$scope.findTreatment = findTreatment;
$scope.selectState = selectState;
$scope.selectedInsurance = selectedInsurance;
$scope.goAndFind = function writeUserData() {
firebase.database().ref('tempdata/' + userId).set({
insurance: $scope.selectedInsurance,
state: $scope.selectState,
treatment: $scope.findTreatment
});
};
$scope.myfunction = function() {
if ($scope.selectState == "Pennsylvania") {
$scope.insurance = [
{ name: "Ford Mustang" },
{ name: "Fiat 500" },
{ name: "Volvo XC90" }
];
} else if ($scope.selectState == "new-jersey") {
$scope.insurance = [
{ name: "lahore" },
{ name: "kamalia" },
{ name: "bingokml" }
];
}
};
});
、これがクリックされた私のボタンのコードです
<input type="button" class="btn-success" id="findTreatment" value="Find Treatment" ng-disabled="myform.$invalid && myform.insurancefield.$invalid" onclick="goAndFind()" />